SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what the difference and where is the mistake

    AND AvailableFrom <='20051215' AND ForRent_AvailableTo >= '2005-12-15'
    AND AvailableFrom <='2005-12-15' AND ForRent_AvailableTo >= '2005-12-15'

    i think the both give the same result..
    but the problem is that if i have a variable in the database with the value les say 2005-12-15 or 20051215 it wont work

    but if i removed on of the AND in the queries then the query work fine
    can we fix this ??

  2. #2
    SitePoint Guru enygmadae's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Tx.
    Posts
    795
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Um, dont you want want it to be:
    AND AvailableFrom >='2005-12-15' AND ForRent_AvailableTo <= '2005-12-15'

    that way it gets what's availible from that date to that date (the same day). The way you had it before it was looking for things before that date and after that date, but not on it.
    PHP News, Views and Community: http://www.phpdeveloper.org


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •