Archives of the TeradataForum
Message Posted: Tue, 25 Feb 2003 @ 19:15:23 GMT
Subj: | | Re: Data extraction question |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Tuesday, February 25, 2003 14:10 -->
EXTRACT ( MONTH FROM A.FLT_ORIG_DT) = 12
AND EXTRACT ( YEAR FROM A.FLT_ORIG_DT) = 2002
| What I want to do is to grab December and the previous 3 months as well. | |
For this particular run, do this:
WHERE FLT_ORIG_DT BETWEEN '2002-09-01' AND '2002-12-31'
If you want to generalize this, you can tell BTEQ to read in a single record with the .IMPORT command and then use it as a "host
variable." If you read in the starting date of the period, you would do this:
WHERE FLT_ORIG_DT >= :START_DATE AND FLT_ORIG_DT < ADD_MONTHS(:START_DATE, 4)
|