Results 1 to 2 of 2

Thread: select between date and time

  1. #1
    Join Date
    Feb 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default select between date and time

    hi to all

    I have field date and time respectively. I want to select date between (date1 and time1 > 17) and (date2 < 17)

    I tried these but unsuccessful.

    any suggestions would greatly appreciated

    tnx

    tirso

    Code:
    SELECT * from purchases_suppliers WHERE (date_invoice >= '2009/02/25' and time_invoice > 17) AND (date_invoice <= '2009/02/27' AND time_invoice < 17)
    or

    Code:
    SELECT * from purchases_suppliers WHERE date_invoice between ('2009/02/25' ANd time_invoice > 17) AND ('2009/02/27' AND time_invoice < 17 )

  2. #2
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default

    What are the types of your date and time columns? What does a date in the database look like?

    For example, a datetime column looks like 2009-03-02 10:59:23 .

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
  •