Convert function (need help. posted this a long time ago. Is this site active?)
Hello,
I have the following WHERE clause in a SQL script that I am trying to turn into a Vertica view. It is my understanding that CONVERT does not exists in Vertica. Does anyone know how to do this in Vertica? I am basically looking for the first of January, 3 years ago.
WHERE DATETIMESTAMP >= CONVERT(DATETIME,'01-01-'+CONVERT(VARCHAR(5),YEAR(DATEADD(YYYY,-3,GETDATE()))));
0
Comments
Here is the answer...
WHERE TO_CHAR(DATETIMESTAMP) >= '01-01-'||TO_CHAR(YEAR(GETDATE())) - 3;