1
 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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Yves Ng
  • 69
  • 10
  • Which RDBMS is this for? SQL is just the query language - but it often does make a difference whether you're using MySQL, PostgreSQL, Oracle, SQL Server or IBM DB2 - or something else even. Please add a relevant tag to your question! – marc_s Nov 25 '17 at 09:05
  • ok i will take your advice next time :D – Yves Ng Nov 25 '17 at 13:49

1 Answers1

0

You need to add FROM clause:

select convert(date, Main_Users_ActivityLog.CreateDate)
FROM Main_Users_ActivityLog;
Lukasz Szozda
  • 162,964
  • 23
  • 234
  • 275