It will be very easy if your records have timestamps (automatically set to
the time when the row was created).
Then you could just write something like this:
SELECT * from yadda where yadda_timestamp < NOW();
Or, if resolution by date is enough (timestamp has YYYYMMDDHHMMSS), you
could try:
SELECT * from yadda where TO_DAYS(yadda_timestamp) < TO_DAYS(NOW());
Good luck,
Eivind
<query, sql>
----- Original Message -----
From: "Chris Kay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 4:10 AM
Subject: Query
>
> I wish to do a query and inside that I wish to grab all records
> That are before todays date/time
>
> Would this work?
>
> $now = date("YmdHi")
>
> Select * from yadda where
'yadda_year,yadda_month,yadda_day,yadda_hour,yadda_min' <= $now
>
> --------------------------------------------------------------------------
-
> Chris Kay
> Technical Support - Techex Communications
> Website: www.techex.com.au Email: [EMAIL PROTECTED]
> Telephone: 1300 88 111 2 - Fax: (02) 9970 5788
> Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102
> Platinum Channel Partner of the Year - Request DSL - Broadband for
Business
> --------------------------------------------------------------------------
-
>
> ---------------------------------------------------------------------
> 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