Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query not working till midnight using now

Status
Not open for further replies.

WilliamMute

Programmer
Jan 4, 2006
117
Hi All, I will appreciate if someone can point me in the right direction as I know this query is somehow not going to do what I want, Infact its not doing what I want but I cant seems to give my brain a boost to think of a way out.

I basically want the query to return results that are NEXT due and display them until its their due day is over. I.e

------------------------------------
Rota for the week begining 22/03/09
--- Person A
--- Person B

-----------------------------------

Rota for Week 29/03/09
--- Person C
--- Person D

-----------------------------------

So since we are in the current active week, it should display the first rota up until sunday night at 11:59:59pm then the second rota becomes active.

My code below only display the current rota, but once its sunday morning, the rota automatically disapear where I want it to remain active until midnight.

Code:
SELECT * from rota WHERE `date`>NOW() ORDER BY `date` ASC LIMIT 1


All help much appreciated in advance, Thank you!
 
Something like:
Code:
SELECT * from rota WHERE `date`>=NOW() ORDER BY `date` ASC LIMIT 1
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.

 
ooo.. Thanks for that Harley! I haven tried it yet but am sure it will work.

Thanks a bunch!
 
Glad I could help [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top