Help using Base SAS procedures

Where= command with formatted date variable

Accepted Solution Solved
Reply
Contributor
Posts: 56
Accepted Solution

Where= command with formatted date variable

Hello everyone,

I hope you are well.

I know my question might seem basic but I can't seem to figure it out.

I am trying to filter my data based on a date variable

My date variable is formatted using yymmdd10.

I tried

Where 20080102 <=date <= 20101231;

Where '20080102'd <=date <= '20101231'd;

Where "2008-01-02" <=date <= "2010-12-31";

Sorry for taking your time. Thank you very much for your help.


Accepted Solutions
Solution
‎03-16-2014 06:09 PM
Super User
Super User
Posts: 7,060

Re: Where= command with formatted date variable

Date literals in SAS use the DATE format. The format attached the variable does not matter as the format does not modify the stored value.

Where '02JAN2008'd <=date <= '31DEC2010'd;

View solution in original post


All Replies
Solution
‎03-16-2014 06:09 PM
Super User
Super User
Posts: 7,060

Re: Where= command with formatted date variable

Date literals in SAS use the DATE format. The format attached the variable does not matter as the format does not modify the stored value.

Where '02JAN2008'd <=date <= '31DEC2010'd;

Contributor
Posts: 56

Re: Where= command with formatted date variable

Oh I did not know that!

Thank you very much Tom. You are always very helpful.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 159 views
  • 0 likes
  • 2 in conversation