SELECT * FROM table WHERE (Status != closed) OR ((Status = closed) AND
(Date Now - # of seconds in 2 weeks))
That should work if your Date field is just a regular timestamp. It all
depends on how you're storing the date...
- Jonathan
-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 7:11 AM
To: [EMAIL PROTECTED]
Subject: 2 queries in one?
I've looked through the docs and I couldn't find out how
to do this. If you can point me to the right place in the
documentation so I can read how, that would be great. If
you could give me a little sample query to start from, that
would be great as well.
I've 2 columns in a table. Status and Date. I want to
select all rows regardless of the values in either. However,
if the status is closed, I only want those closed records
that are less than 2 weeks old.
Can this be done in one query? If so, how? And where
can I read how to do this in the docs?
thnx,
Chris
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php