Results 1 to 6 of 6

Thread: HELP - Dates

  1. #1
    Join Date
    Feb 2004
    Posts
    41

    Unanswered: HELP - Dates

    Hey, Ive got to do a query that returns the vehicles which are presently not rented - i have a start_date and an end_date but i cant figure out how to do it! i dont know how to get todays date not to equal the period of time between the two dates?! plz help!!
    Ive tried Date() <> Between [date_start] And [date_end] but i just keep getting syntax errors
    Ive also tried Date() < [date_start] and > [date_return] but same problem!!
    Thanks

    Any more suggestions plz cos ive literally tried everything and i know its something straight forward and its driving me mad!!
    Last edited by jill83; 02-01-04 at 12:54.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: HELP - Dates

    Originally posted by jill83
    Hey, Ive got to do a query that returns the vehicles which are presently not rented - i have a start_date and an end_date but i cant figure out how to do it! i dont know how to get todays date not to equal the period of time between the two dates?! plz help!!
    Ive tried Date() <> Between [date_start] And [date_end] but i just keep getting syntax errors
    Ive also tried Date() < [date_start] and > [date_return] but same problem!!
    Thanks
    ... WHERE (Date < MyTable.date_start AND Date > MyTable.date_end);

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    M Owen, i do believe you wanted an OR instead of an AND

    if [date_start] comes before [date_end], i can't see any date that would be before [date_start] and after [date_end] at the same time



    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by r937
    M Owen, i do believe you wanted an OR instead of an AND

    if [date_start] comes before [date_end], i can't see any date that would be before [date_start] and after [date_end] at the same time



    OOOPS!!!! I blame it on the SuperBowl ... Definitely an OR ... Kids: Don't mix English and logic together. It will make you look like an idiot ...

  5. #5
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421

    Wink

    Hmz, and thats me thinking the warning lable should read:

    Kids dont mix logic and woman

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by namliam
    Hmz, and thats me thinking the warning lable should read:

    Kids dont mix logic and woman
    I'm not gonna touch that one at all ... I'll let you get all the flame mail ...

Posting Permissions

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