By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,639 Members | 3,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,639 IT Pros & Developers. It's quick & easy.

Query help (dates and times)

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.