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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2640 views
  • 0 likes
  • 2 in conversation