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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT ..WHERE date >= curdate() 2

Status
Not open for further replies.

bccamp

Technical User
Jan 20, 2005
69
I've been struggling with this problem for a while. I've got a db with expiration dates for some entries, and NULL for other expiration date entries. I'm displaying on a page with tables for each entry and I've been trying to code all the php exceptions for all the possible variables that I want to display. When I fix one thing, another breaks. It would be easier if I could remove all expired entries without removing the NULL entries from the original SELECT db query. Please help...
 
WHERE date >= curdate() or (date is null)

Known is handfull, Unknown is worldfull
 
Thanks, I wish I had've asked sooner. Saved me countless hours of programming and error correction.

final code:
SELECT Company FROM $table WHERE Company = '$cn' AND (Exp>=curdate() OR (Exp is NULL)) ORDER BY Company ASC, Exp ASC
 
This is very helpful!! I was doing it the long way before which was 30 lines of code but this does it in 1. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top