longmatch
Programmer
- Nov 1, 2001
- 406
I have an Access 2000 database, which was upsized into our local sql server 7.0. The connection is working right now. I also tested with a simple query, it is fine.
But a query working in Access database, does not work in sql server any more. Anybody know the reason. Please refer the query below.
strSQL = "SELECT Resident, count(rotation) as No FROM (SELECT B.ID, B.Resident, B.Blockname, B.StartDate, B.EndDate, B.Rotation, R.PGY, R.Track FROM tbl_blockInfo as B INNER JOIN tbl_resident as R ON B.Resident = R.Resident WHERE R.PGY =" & PGY & " group by Resident"
the error massage is
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near the keyword 'group'.
/haijunw/resident_schedule/TMPf45kcdenux.asp, line 40
The query is on the line 40 right now.
Thanks
longmatch
But a query working in Access database, does not work in sql server any more. Anybody know the reason. Please refer the query below.
strSQL = "SELECT Resident, count(rotation) as No FROM (SELECT B.ID, B.Resident, B.Blockname, B.StartDate, B.EndDate, B.Rotation, R.PGY, R.Track FROM tbl_blockInfo as B INNER JOIN tbl_resident as R ON B.Resident = R.Resident WHERE R.PGY =" & PGY & " group by Resident"
the error massage is
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near the keyword 'group'.
/haijunw/resident_schedule/TMPf45kcdenux.asp, line 40
The query is on the line 40 right now.
Thanks
longmatch