cancel
Showing results for 
Search instead for 
Did you mean: 

GRC 5.3 Open SQL select date syntax question

Former Member
0 Kudos

Hi Experts!!

Trying to use SQL to extract the data from JAVA Table VT_AE_CHG_LOG as the actual user screen does not allow download. We would like only the Data after a certain date.

Here is the SQL stmt: Select * from VT_AE_CHG_LOG where CHG_TIME > '06/30/2011 08:30:30'

Here is the error that it returns: ERROR: The SQL statement "SELECT * FROM "VT_AE_CHG_LOG" WHERE "CHG_TIME" > '06/30/2011 08:30:30'" contains the semantics error[s]: - 1:35 - type check error: the left hand side >>"CHG_TIME"<< (TIMESTAMP) and the right hand side >>'06/30/2011 08:30:30'<< (CHAR) of a comparison operator are not comparable

Help on the syntax would be much appreciated!!

Thanks,

John

Edited by: John Stephens on Aug 18, 2011 1:02 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi John,

The problem is with the time format. Use the comfort function:

CONVERT(varchar, CONVERT(datetime, 'Your date & Time')))

Regards,

Raghu

Answers (0)