I have SQL date time field that downloaded as text field.
03/01/2021 11:35
used the following code to read..
input(trans_Date,anydtdtm.) as Date_Transfered format=dtdate9.,
but when I try to query the data :
where Date_Transfered >= '01MAR2021'd; where clause is not working and it's pulling all the observations.
What did I miss?
Thank you
You do a god jobs of transforming the string into a datetime.
That means you must filter on a datetime value:
datepart(DATE_TRANSFERED) >= '01MAR2021'd;
or (better)
DATE_TRANSFERED >= '01MAR2021:00:00:00'dt;
Hint: look at the unformatted values when in doubt.
You do a god jobs of transforming the string into a datetime.
That means you must filter on a datetime value:
datepart(DATE_TRANSFERED) >= '01MAR2021'd;
or (better)
DATE_TRANSFERED >= '01MAR2021:00:00:00'dt;
Hint: look at the unformatted values when in doubt.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.