BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DWhite
Obsidian | Level 7

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. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Can we assume that UTCDateTime never contains values that go into the future?

 

You should be able to change = TODAY()-30 to >= TODAY()-30

View solution in original post

2 REPLIES 2
Astounding
PROC Star

Can we assume that UTCDateTime never contains values that go into the future?

 

You should be able to change = TODAY()-30 to >= TODAY()-30

DWhite
Obsidian | Level 7
Yes. That worked. Thanks.

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 2 replies
  • 3091 views
  • 0 likes
  • 2 in conversation