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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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