sqlsql-convert

The multi-part identifier could not be found via convert query


 select convert(date, Main_Users_ActivityLog.CreateDate);

I'm having trouble working on this query. How can I convert all contributions from a column to the type I wish to use, only a line of code?


Solution

  • You need to add FROM clause:

    select convert(date, Main_Users_ActivityLog.CreateDate)
    FROM Main_Users_ActivityLog;