jp2631 jp2631 - 2 years ago 114
SQL Question

Type EAL.STATUS_DATE is not a defined system type

All, I'm trying to shorting my date and time data. Here is the current code...


2016-04-18 00:00:00.000

and I want it to returns only 2016-04-18
I tried this code ISNULL(CONVERT(EAL.STATUS_DATE,'01/01/1960'),110) AS STATUS_DATE but got this error Type EAL.STATUS_DATE is not a defined system type.

Please help

Answer Source

You got the two functions mixed together incorrectly. the convert belongs only around the datetime field. then you do the isnull on the outside of that. You also have the syntax of convert wrong.

ISNULL(CONVERT(date,EAL.STATUS_DATE,110), '01/01/1960') 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download