Results 1 to 4 of 4

Thread: Date query

  1. #1
    Join Date
    Jun 2003
    Posts
    17

    Unanswered: Date query

    How can I create a query wich will display only records beetween two dates regardles the day of the month.
    example:
    If the parameter date is 10.5.2003,
    The first date is 15.5.2003, the second date is 1.7.2003.
    The query must display also records between 10.5 and 15.5.

    Thanks in advance
    Korado

  2. #2
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Re: Date query

    I don't get your question.

    Do you mean regardless the year?

    What is the relation between your parameter and your date fields. Could you give an example?
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

  3. #3
    Join Date
    Jun 2003
    Posts
    17
    I would like to display records where the month of the start/end date is between the parameter month date, regardles the day(could be before/after the start/end day date).

    Thanks
    Korado

  4. #4
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447
    Originally posted by Korado
    I would like to display records where the month of the start/end date is between the parameter month date, regardles the day(could be before/after the start/end day date).

    Thanks
    Korado
    Regardless the year?

    So, you mean something like:

    WHERE month[Parameter Date]) BETWEEN month([Start Date]) AND month([End Date])

    ?

    This is syntactically correct, including the month() function, but I'm afraid that this isn't what you are looking for. Records with a start date in january and end date december will always fit your condition, regardless your parameter. Records with a start date in december and an end date in january, however, will never fit. So, I recommand re-thinking your problem.
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

Posting Permissions

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