[PHP] RE: [PHP-DB] mySQL Query From: Wesley Choate (wesleyc <email protected>)
Date: 08/11/00

something like this

select * from table_name where TO_DAYS(NOW)) - TO_DAYS(field_name) = 1;

That should work..

> -----Original Message-----
> From: Ralph Guzman [SMTP:raguzman <email protected>]
> Sent: Friday, August 11, 2000 6:49 PM
> To: PHP General Mailing List; PHP DB Mailing List
> Subject: [PHP-DB] mySQL Query
>
> Can somebody provide me with an example of how I can write a query that
> will
> display results for the previous day.
>
> in the mySQL table I have a field for date that uses this format:
>
> YYYY-MM-DD
>
> so if today is 2000-08-11
>
> I need to get everything for 2000-08-10
>
> your help is appreciated.
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe <email protected>
> For additional commands, e-mail: php-db-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>