@DavidPhillips2 wrote:
I'm querying today's date to see what datetimes stored in the large transaction table fall within today's date. The feeding the two date ranges into a where clause.
If I use the number of seconds from 1960, how do I insert the result into a where clause and increment it back a year.
Same as changing a date by a year, use the INTNX function. Use interval DTYEAR so SAS know you are incrementing a datetime value.
data example;
x= dhms(today(),9,15,20);
format x datetime20.;
y1 = intnx('dtyear',x,-1,'b');
y2 = intnx('dtyear',x,-1,'s');
y3 = intnx('dtyear',x,-1,'e');
format y: datetime20.;
run;