08-03-2011 01:39 PM
I'm new to SAS so forgive me if this has been answered elsewhere. I didn't have any luck searching the forums.
My data set is coming from SQL server and the field is listed as DATETIME22.3. When I try to filter on the date field, here is the error I receive:
CREATE TABLE WORK.QUERY_FOR_LOANNOTE AS
FROM CLST04.LoanNote t1
WHERE t1.NoteDt > '03Aug2011:12:30:00'dt AND t1.StoreId = 'AL102';
ERROR: CLI open cursor error: [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or
time from character string. : [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared.
If I filter by the date only, (WHERE t1.NoteDt > '03Aug2011'd), that pulls back correctly. I just can't figure out the correct syntax to also sort by time.