Query help (dates and times)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • StinkFinger

    Query help (dates and times)

    All,
    Struggling with a query here.

    table name : holidays
    fields : holname (format varchar)
    holdate (format date 2004-01-01)

    The table is populated with all the holidays for the next 5 years. I am
    trying to select only 1 of each holiday for the current year, AND if todays
    date is past a holiday for the current year, then select the following years
    holiday.

    For example, today date would return easter, mothers day, etc. AND next
    years valentines (because it is past 2004-02-14).
    Does this make sense ?

    Many thanks for any help.


  • News

    #2
    Re: Query help (dates and times)

    select holname,holdate from holidays where holdate <= date_add(curdat e(),
    interval 364 day);

    "StinkFinge r" <stinky@pinky.c om> wrote in message
    news:107ju3pnch 4t073@corp.supe rnews.com...[color=blue]
    > All,
    > Struggling with a query here.
    >
    > table name : holidays
    > fields : holname (format varchar)
    > holdate (format date 2004-01-01)
    >
    > The table is populated with all the holidays for the next 5 years. I am
    > trying to select only 1 of each holiday for the current year, AND if[/color]
    todays[color=blue]
    > date is past a holiday for the current year, then select the following[/color]
    years[color=blue]
    > holiday.
    >
    > For example, today date would return easter, mothers day, etc. AND next
    > years valentines (because it is past 2004-02-14).
    > Does this make sense ?
    >
    > Many thanks for any help.
    >
    >[/color]


    Comment

    Working...