Below is a query I created in Access. It works perfectly fine for the Access query, but I would like to put it in a web page to work alongside some other queries I have created. I would also like to have it print out the results for every hour in a 24 hour period and not just one hour on one date.
In my existing query, I am allowing the user to select the date and the extension. The date is $id and the extension is $ex. I am also doing some math on the information and just returning total existing records, not a list of all records created within that time frame.
I would like a little help developing this code if possible, if not, maybe just a conversion to the right syntax (I can't figure it out).
HERE IS MY CURRENT QUERY:
$sql = "SELECT Count(*) AS TotalNumberOfCalls FROM AllInfo WHERE Extension = '$ex' AND Date=#".$id."#";
$time = "SELECT Date, Extension, sum(DurationS) AS CountOfDuration
FROM AllInfo
WHERE Extension = '$ex' AND Date=#$id#
GROUP BY Date, Extension";
HERE IS THE ACCESS QUERY I NEED INTEGRATED INTO THIS (but I need a line printed out for all hours, not just one hour) I have the date and time hardcoded in this, but it should reference the variables as listed in the query above.:
SELECT AllInfo.Time, AllInfo.Date, AllInfo.Extension
FROM AllInfo
WHERE (((AllInfo.Time) Between #12/30/1899 9:0:0# And #12/30/1899 10:0:0#) AND ((AllInfo.Date)=#3/12/2008#) AND ((AllInfo.Extension)="3883"))
ORDER BY AllInfo.Time;
Thank you in advance for the use of your massive brainpower(s).