I want to convert an MS SQL Query to an IBM Query. I currently have MS SQL Code like:
But my IBMi file has the equivalent date stored in an 8,0 field as 20200805
I think I need to CAST the IBM column to DATE, then I can do a DIFF, but getting stuck on the syntax, or if it's even allowed to cast 8,0 as a date.
Thoughts ?
Code:
CASE WHEN DATEDIFF(day, LM.LastRcdDateforLot, GETDATE()) >= 361 THEN '6'
I think I need to CAST the IBM column to DATE, then I can do a DIFF, but getting stuck on the syntax, or if it's even allowed to cast 8,0 as a date.
Thoughts ?
Comment