Jump to content

query tomorrow


dadamssg

Recommended Posts

k this isn't really the same as querying tom, but im trying not to open any new threads  :-[ anyways....im trying to query today...i thought i had it. I want to query everything going on today, whether its starting, ending, or today lands in between start and end. this is what i have which almost works...

 

SELECT * FROM test WHERE start <= NOW() AND end >= NOW() ORDER BY start ASC

 

it does not, however, pull up events that are happenning today but haven't started yet, examples below

 

i queried this at 12:50 pm and it pulled up

 

id              start                end

88  | 2/4/2009 1:00pm | 3/4/2009 1:00pm

85  | 3/1/2009 1:00pm | 3/3/2009 2:00pm

98  | 3/4/2009 1:00am | 3/6/2009 9:30pm

104 | 3/3/2009 1:00am | 3/3/2009 4:00pm

 

all these are correct BUT i also had the following in the database that it did NOT pull up

 

id              start                end

103  | 3/3/2009 1:00pm | 3/3/2009 7:00pm

105  | 3/3/2009 2:00pm | 3/3/2009 7:00pm

 

it didn't because 'start <= NOW()' but i don't really now what to replace this part with

 

oh and then when i queried at 1:10pm it pulled up event #103 of course

 

REAL LONG post but help would be MUCH appreciated thanks

Link to comment
https://forums.phpfreaks.com/topic/147468-query-tomorrow/#findComment-775874
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.