Posted By

cori on 05/20/09


dates null comparison SAP

Versions (?)

SAP Date Comparison

 / Published in: SQL

this little snippet can be used to compare an SAP Date (which might be empty, or '00000000') to today's date, for instance to query for rows that have been closed in the last x days. Can't CAST the date column (in 'YYYYMMDD' format) to a date for use in where clauses, since '00000000' can't be cast to a datetime

  1. CAST(CONVERT( CHAR(8),GETDATE(),112) AS int)-A.IDAT2 <= @CompletedDateWindow

Report this snippet  

You need to login to post a comment.