BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sarahzhou
Quartz | Level 8

Hi, 

 

I encounter a problem when querying a data range in SQL server, when the comparison is less than a 'date', it went wrong. However, when a date is equal to a 'date' it works.

 

the blow query has an error;

proc sql noprint;
connect to sqlver as myserver (darasrc="share_data" authdomain="nopassword");
create table class_schedule as sellect * from connect to myserver 
(select * from table_classA where class_date <'01NOV2022');
disconnect from sqltgt;
quit;

 

the blow query has no errors;

proc sql noprint;
connect to sqlver as myserver (darasrc="share_data" authdomain="nopassword");
create table class_schedule as sellect * from connect to myserver 
(select * from table_classA where class_date ='01NOV2022');
disconnect from sqltgt;
quit;

 

But, I am interested in selecting the data less than a date, I need to use the "<" sign. How can I achieve that?

 

Kindly help.

Thank you!

1 ACCEPTED SOLUTION
4 REPLIES 4
sarahzhou
Quartz | Level 8

I found the problem. Thanks, pls ignore.

 

 

LinusH
Tourmaline | Level 20
Or, tell us how you solved it for the benefit of others.
Data never sleeps
sarahzhou
Quartz | Level 8

Thank you @Kurt_Bremser 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1492 views
  • 0 likes
  • 3 in conversation