I'm having an issue adding time to a date with PROC SQL. Using PROC SQL, the column I am pulling is formatted as a MMDDYY10.
. I need to add x days, y hours, and z minutes to this date. My biggest issue now is just getting a zeroed out time stamp attached.
I promise, I've been all over the web before coming here and nothing has been exactly what I need. I feel crazy, this doesn't seem like something that should be so hard to do!
The closest I've been to my goal is using:
SELECT
DHMS(myDateVar,0,0,0) AS myDateVar FORMAT = DATETIME22.
FROM
tableName
However, this just returns my date variable (which is just today for now) with the random time of 20:48:37
Ultimately, the data set being selected is going to be appended to a SQL server table that SAS recognizes as a DATETIME22.
formatted column.
So, can anyone give me a hand adding x days, y hours, and z minutes to a date MMDDYY10.
in a PROC SQL select statement?
datetime22.
. You have the decimal in the wrong place – Robert Penridge