November 12th, 2010, 05:00 PM
Problem by using "like" version 2.5
With the novelty of the new version of Firebird (2.5) we decided to upgrade all our sites, using firebird 1.5.
To be doing the tests we find a sentence you use a lot and did not return any results this is something like:
Select * from ttabla_ventas where venta_fecha like '2010-11-01%'
Where venta_fecha is a timestamp and quickly reached the conclusion that this form of like the new version was not being done correctly and that by using the operators> = and <= if you get the information expected, this type of queries (using like ) is a large part of the application modules that use the sites, so now (for now) is less expensive to prevent the change to update the application.
Anyone know if the like is no longer supported or have changed the format to use?
November 12th, 2010, 06:49 PM
Seems like a terrible way to approach this anyway (IMO).
Why are you using like rather than simply extracting the date portion from venta_fecha and explicitly casting 2010-11-01 to a date for a simple equality test?
November 13th, 2010, 04:08 PM
+1 on the terrible approach, LIKE on a timestamp field shouldn't have worked since day 0 ...