470,862 Members | 1,835 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,862 developers. It's quick & easy.

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.
Jul 17 '05 #1
1 1153
select holname,holdate from holidays where holdate <= date_add(curdate(),
interval 364 day);

"StinkFinger" <st****@pinky.com> wrote in message
news:10*************@corp.supernews.com...
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.

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by paii | last post: by
1 post views Thread by Simon Bailey | last post: by
5 posts views Thread by Alicia | last post: by
3 posts views Thread by Serious_Practitioner | last post: by
11 posts views Thread by Andy_Khosravi | last post: by
5 posts views Thread by Stan | last post: by
3 posts views Thread by jed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.