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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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