If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > SELECTing working days

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-15-05, 08:36
gtk gtk is offline
Registered User
 
Join Date: Oct 2004
Location: Paris, FRANCE
Posts: 132
Post SELECTing working days

I'd like to get the list of working days between to dates without having to use my script langage.
This is in order to LEFT JOIN it to a table containing some figures by day.

Example:
between 2005-12-18 and 2005-12-25
Here are my figures
Code:
2005-12-20 | 5
2005-12-22 | 3
2005-12-23 | 2
Here is what i'd like to have generated (working days between 2005-12-18 and 2005-12-25)
Code:
2005-12-19
2005-12-20
2005-12-21
2005-12-22
2005-12-23
Here will be the LEFT JOINt result
Code:
2005-12-19 |
2005-12-20 | 5
2005-12-21 |
2005-12-22 | 3
2005-12-23 | 2
Reply With Quote
  #2 (permalink)  
Old 12-15-05, 14:56
felixg felixg is offline
Registered User
 
Join Date: Apr 2005
Location: Lier, Belgium
Posts: 122
Quote:
Originally Posted by gtk
I'd like to get the list of working days between to dates
Use a calendar table. See http://www.dbforums.com/t981086.html
--
felix
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On