Hi,
I'm using SQL Server and querying it with php. I have a query that selects data based on dates entered.
$tsql = "SELECT COUNT(tblBackupArchive.StatusID) AS total, tblBackupArchive.StatusID ".
"FROM tblBackupArchive INNER JOIN ".
"tblBackup ON tblBackupArchive.BackupID = tblBackup.BackupID ".
"WHERE (tblBackupArchive.BackupDate BETWEEN '" . $from ."' AND '" . $to . "' ".
"GROUP BY tblBackupArchive.StatusID, tblBackup.ClientID ".
"HAVING (tblBackup.ClientID = " . $bmsid . ")";
I'm getting
Incorrect syntax near the keyword 'GROUP'. ) )
The dates are coming from textboxes (jquery calendar) in the format 'dd/mm/yyyy'.
Not sure what it is I'm doing some here :(
Any help most appreciated,
Jonesy