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 > Populate Start_Date and End_Date

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-04-09, 16:16
WhisperingAngel WhisperingAngel is offline
Registered User
 
Join Date: Sep 2009
Posts: 1
Populate Start_Date and End_Date

I had the following fields, with a single record and I want to populate base on start and end date, length and repeat every:

start_date = "08/03/09" (starts on)
end_date = "08/21/09" (ends on)
the_length = "1" (everyday)
repeat_every = "2" (with an interval of 2 days)

Now, I want to use SQL statement to populate the result "everyday" but with an interval of "2" days, starting from "start_date" up to "end_date".
I was able to solve the problem on the application side (using Array and lots of IF statements), but I know this can be solved using a single Query/SQL Statement or a Stored Procedure.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 09-04-09, 23:54
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
could you please do a SHOW CREATE TABLE for your table

it's sort of clear what you want to insert, but not really clear where you want to insert it
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
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