Ye gods, every morning at the station the announcer tells me the train is express between Malvern to South Yarra, and it's so so so wrong, it make me want to scream.
The english language is doomed I tell you. DOOMED!
Oh, and remember, the between ... and ... statement is inclusive of both numbers.
Or were you needing help getting the first and last of last month? That one's a bit more tricky, but it's fun to work out. You need the INTNX function which you can use to get to the first of a month easily enough. You'll possibly need to nest a couple of them to get the correct day, experiment with a couple of lines and you'll get it quickly enough. I have to work it out from scratch each time myself.
Doco on INTNX is here:-
The sysdate variable that you mention, is that the SAS Sysdate variable? The reason I ask is you don't need that date to get the current date. Perhaps you could do the following.
Code:
PROC SQL;
SELECT * FROM TABLE1
WHERE (month(today())-1) eq month(START_DATE) and year(today()-31) eq year(start_date);
QUIT;
This presumes that your start_date variable is a SAS date variable and not a datetime variable.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.