#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Posts
    1
    Rep Power
    0

    Problem by using "like" version 2.5


    Hello
    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?

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    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?
  4. #3
  5. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539

IMN logo majestic logo threadwatch logo seochat tools logo