Datpart and convert function
I have thid query,
SELECT DISTINCT DATEPART(year, dateprinted) +Convert(VarChar(20), dateprinted, 103) AS Year
FROM tbl_pcounterlog
ORDER BY Year
BWhen I pars it it says that it is okay yet when I run it I get the following error,
Syntax error converting the varchar value '01/02/2007 08:11' to a column of data type int.
What am I doing wrong
Thanks
Greg
|