Hello.
I am trying to select the past 30 days of data from the current date/time for multiple groups in SAS DI. This is a streaming data set that has new observations every 10 minutes. Schedule manager updates this SAS table every hour.
My time is of the format: 08June2018:14:40:00.000 and named UTCDateTime
My group is based on a multiple categorical values in the "name" column
I have added a "group_by" on "name" and setup a "having" statement using the TODAY function thinking that it would report the past 30 days, but it only reports all of the timestamps for the past 30th day (which make sense now!).
DATEPART(UTCDateTime) = TODAY()-30
Thanks in advance for your assistance.
Can we assume that UTCDateTime never contains values that go into the future?
You should be able to change = TODAY()-30 to >= TODAY()-30
Can we assume that UTCDateTime never contains values that go into the future?
You should be able to change = TODAY()-30 to >= TODAY()-30
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.