I have an application that generates the following SQL. SELECT Month( AL1.load_date ), Count (AL1.trip_id) FROM iw.tspmastr AL1
WHERE (AL1.load_date>?TETIME (2002-01-01 00:00:00.000) YEAR TO FRACTION(5)) GROUP BY Month( AL1.load_date )
The database returns an error.
If I modify the SQL to be: SELECT Month( AL1.load_date ), Count (AL1.trip_id) FROM iw.tspmastr AL1
WHERE (AL1.load_date>?TETIME (2002-01-01 00:00:00.000) YEAR TO FRACTION(5)) GROUP BY Month( 1 )
it works. Should the database support both? Is it a driver issue? Or is the SQL in the first statement simply wrong and not ANSI standard?
the database is Informix.