BookmarkSubscribeRSS Feed
ren2010
Obsidian | Level 7
I have a date variable where dates are stored as mmddyyyy format,
how do i check the date variable using sql where condition?
Suppose i want to select all records whre date is greater than 01012009
what will be sql for this.
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest you search the forum archives - a popular post/topic/question. Also, how about the SAS support http://support.sas.com/ website with a suitable search there as well?

Scott Barry
SBBWorks, Inc.
venkatesh
Calcite | Level 5
proc sql;
select *from dataset name
where date ge '01012009'd ;
quit;
Cynthia_sas
SAS Super FREQ
Hi:
Please refer to the documentation on using constants in expressions:
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000780334.htm

Particularly, the use of date constants requires that the date constant be expressed in the form: ddMMMyy or ddMMMyyyy, as shown below:
[pre]
Use the following patterns to create date and time constants:

date='1jan2006'd;

date='01jan04'd;

[/pre]

cynthia

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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