Jump to content


Photo

Need Date Query


  • Please log in to reply
5 replies to this topic

#1 scoorton

scoorton
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 01 June 2006 - 02:57 PM

I need a mysql statement that does the following if I provide two dates such as 06-01-2006 thru 06-07-2006. Which will return the day of the week (Thurdsday, and the date 06-01-2006). So it would have two items as follows:

2006-01-10 Thursday
2006-01-11 Friday
2006-01-12 Saturday
etc.

Thanks
Scott

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 01 June 2006 - 03:06 PM

Can you try that explanation again, please? What's it got to do with MySQL and why are there three date items in the list example you gave when your question appears to refer to two?
Legend has it that reading the manual never killed anyone.
My site

#3 scoorton

scoorton
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 01 June 2006 - 03:17 PM

I need a mysql query that if I feed the the query two dates such as 2006-06-01 and 2006-06-07, I need the query to spit out the date and the day of week. as stated above.

So the user inputs two dates to search between and the query will take that and generate the following.

2006-06-01 Thursday
2006-06-02 Friday
2006-06-03 Saturday

I need these to process the rest of the php script and I know that mysql can produce these items.

Thanks
Scott

#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 01 June 2006 - 05:48 PM

That still doesn't make sense -- I don't understand what the date range has to do with this. What do you want MySQL to do with each date?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#5 scoorton

scoorton
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 01 June 2006 - 09:55 PM

I have a scheduling script that shows the days of the business week. Mon-Fri. So the user can input two dates into a form to search for that weeks appts. So I need to gather each of those dates so june 1 thru June 7 and the days that those dates fall on. Such as June 2 is a Wednesday. June 3 a Thursday. Then I take that info into an array and grab the scheduled appts for those dates and display to the screen according to the day of the week. Mon Tues Wednes etc.

Cause we only need the business days appt since that is when they are only scheduled.



#6 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 02 June 2006 - 02:28 AM

I still don't know what you want MySQL to do -- the input 2 dates, and you want the days of the week? That doesn't make sense.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users