I'd like to thank everyone for their responses...  After trying many 
variations, I finally figured it out.  By changing the single quotes back 
to double quotes (normally some of the parameters to the where clause are 
variables), I changed the double quotes around the first DatePart argument 
to single quotes, and it worked.

    $query1 = "SELECT COUNT(RunNumber) AS RunCount, DatePart('m', CallDate) 
AS MonNum
                FROM CallData
                WHERE  (CallDate Between #1/1/$year# AND #12/31/$year#)
                   AND Driver = $driver
                GROUP BY DatePart('m', CallDate)";

Thanks again,

SWS



>>I'm trying to get the following query to work:
>>
>>     $query1 = 'SELECT COUNT(RunNumber) AS RunCount,
>>                       DatePart("m", CallDate) AS MonNum
>>                 FROM CallData
>>                 WHERE (CallDate Between #1/1/00# AND #12/31/00#)
>>                   AND Driver = 1731
>>                 GROUP BY DatePart("m", CallDate)';
>>
>>It returns the following error:
>>
>>Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few 
>>parameters. Expected 1., SQL state 07001 in SQLExecDirect in 
>>d:\internet\apache\htdocs\db\test.php on line 48


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to