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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.