Hello,
I want to create a column whereby if the Updated_DateTime field is null, then convert the Created Date Time Field, otherwise, convert the Updated Date Time field and call it LastUpdatedDate.
Can someone tell me why Im getting the following error: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'AS', from the following code:
SELECT If(IsNull(CD.LastUpdated_DateTime, Convert(VarChar(8), CD.CreatedDateTime, 1), Convert(VarChar(8), CD.LastUpdated_DateTime, 1) AS [LastUpdatedDate],
FROM HubInv.Call_Details AS CD
I want to create a column whereby if the Updated_DateTime field is null, then convert the Created Date Time Field, otherwise, convert the Updated Date Time field and call it LastUpdatedDate.
Can someone tell me why Im getting the following error: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'AS', from the following code:
SELECT If(IsNull(CD.LastUpdated_DateTime, Convert(VarChar(8), CD.CreatedDateTime, 1), Convert(VarChar(8), CD.LastUpdated_DateTime, 1) AS [LastUpdatedDate],
FROM HubInv.Call_Details AS CD