[plug] Mysql limit problem

Anthony J. Breeds-Taurima tony at cantech.net.au
Fri Feb 7 13:42:28 WST 2003


On Fri, 7 Feb 2003, Shayne O'Neill wrote:

> 
> Ok I've got a bunch a records in a mysql database with appointments time
> in a datetime field.What SQL would I send to mysql to retrieve only the
> fields in a particular month if I have $global_month and $global_year defined
> 
> (Ie
> 
> $global_month = 2;
> $global_year = 2003;
> 
> SELECT * from appointments where ?????????

SELECT * 
FROM appointments 
WHERE Date >= '2003-02-01 00:00:00 +0800' AND
      Date <= '2003-03-01 00:00:00 +0800';

would be my guess.

Yours Tony.

/*
 * "The significant problems we face cannot be solved at the 
 * same level of thinking we were at when we created them."
 * --Albert Einstein
 */



More information about the plug mailing list