SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : The Server :

Previous DiscussionNext Discussion
 NOW() +1

Probably a really simple one but I'm stuck I can select records from a recordset based upon dates up until today -

SELECT *
FROM events
WHERE events.eventDate>=NOW()
ORDER BY events.eventDate

But that misses out any records for TODAY!!

I tried variations on NOW()+1 but am stuck and can find no online reference to it whichreally surprised me as I assume this must be a common requirement!?

Any pointers?

Started By Jockrock on Oct 23, 2009 at 8:22:51 AM

4 Response(s) | Reply

Earlier Replies | Replies 1 to 4 of 4 | Later Replies
Monte on Oct 23, 2009 at 2:30:54 PM (# 1)

What DB are you using?

Is there a TODAY()?

Or maybe it's a formatting issue with the date.

How is events.eventDate formatted compared to NOW()?


Jockrock on Oct 23, 2009 at 3:58:20 PM (# 2)
This message has been edited.

Database is MySQL using PHP event date formatted yyyy-mm-dd. Aha - OK I got it! I am new to MySQL and never realised it has a function CURDATE() - That fixed the issue. Thanks for input!


Terry Young on Oct 29, 2009 at 10:46:16 AM (# 3)

It's interesting, to think of it now, that I never knew nor used CURDATE() for all these years. I simply rely on PHP or ASP or whatever, and inject the date literal into the SQL statement.


Jockrock on Oct 30, 2009 at 5:35:49 PM (# 4)

I am living testament to the lie that states you can't teach an old dog new tricks!


Earlier Replies | Replies 1 to 4 of 4 | Later Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.