December 24, 2014, 01:44 AM
B_BUsing between command
I am using 'between' command to display current saturdays date and 13 weeks ago saturday date. It throws an error.
Is there any other way if i can use GE or LE?
I have also tried-
WHERE WE_DATE GE '&SAT12AGO' AND LE '&SAT1AGO'
any suggestions?
December 24, 2014, 02:22 AM
Ram Prasad EYou need to use FROM TO keyword instead of BETWEEN. Try below code.
TABLE FILE EMPLOYEE
PRINT
FIRST_NAME
HIRE_DATE
WHERE HIRE_DATE FROM 800601 TO 850601;
END
Hope this helps.
Thanks,
Ram
December 24, 2014, 02:56 AM
Daveor...
WHERE WE_DATE GE '&SAT12AGO'
WHERE WE_DATE LE '&SAT1AGO'
December 24, 2014, 08:16 AM
Jay PotterIs your date format alpha or numeric? You may need to remove the single quotes.
December 24, 2014, 11:21 AM
George PattonIf I read the question correctly only two dates are wanted, not the entire range from 13 weeks ago till the most recent Saturday.
I think one way to do it would be to set the most recent Saturday as the first day of the week using SET WEEKFIRST and then use DATEADD to subtract 13 weeks.