|
Hello david,
If I see it right, you must simply use the following:
if datepart(Srvy_DT) > '04APR2001'd;
greetings from schwaebisch hall, germany
ronald hoellwarth
---------------------- Weitergeleitet von Ronald Höllwarth/PK/Kreditwerk on
09.05.2001 09:22 ---------------------------
"David L. Alderton Ph.D." <David.Alderton@ATT.NET>@LISTSERV.UGA.EDU> on
09.05.2001 05:19:58
Bitte antworten an David.Alderton@PERSNET.Navy.mil
Gesendet von: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
An: SAS-L@LISTSERV.UGA.EDU
Kopie: (Blindkopie: Ronald Höllwarth/PK/Kreditwerk)
Thema: [SAS-L] Help with DateTime22.3 format
I'm pulling data off a SQL Server 7 database. One of the variables is the
date a survey was filled out. It comes across as a SAS numeric variable
with a datetime22.3 format. For example '07FEB2001:09:30:20.177' is one
value with a crazy numeric translation of 1297157420.177 which I guess is
the number of minutes since some date. Anyway, what I am trying to do is
subset the data as I bring it across from the server based on the last time
I pulled the data. Say I pulled the data from the beginning of the survey
until 4 April 01. This time I want to get just the surveys that have been
filled out since 4 April 01 (to today). I cannot for the life of me figure
out how to translate the datetime22.3 into just a traditional date (e.g.,
'04APR01'd) nor can I figure out how to create a variable on the same metric
as the datetime22.3 value to use for comparison.
Ideally, I simply want to create a constant for use in a subsetting "if"
statement...
if Srvy_DT > XXX;
Where XXX would be directly comparable number to Srvy_DT (datetime22.3
format). Or, I want to translate the Srvy_DT into a standard date
'04APR01'd and then compare it to another standard date.
Can anyone help? I have never used dates in this format and I am stumped.
Thanks, David.
David L. Alderton, Ph.D.
Institute for Selection and Classification
Navy Personnel Research, Studies, and Technology
Navy Personnel Command
|