Insert with count records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to insert the results from a recordset into a table. I have my
sql statement and it appears to work fine when I run it on its own function
but it is not doing what I am telling it to do. Can anyone see what I am
doing wrong? Thanks
this is my sql statement.
----------------------------------------------------------------------------------------------
strSqlDump = "INSERT INTO fldTempCountByRDO (fldCountOfRDO, fldRDO, fldName)
Select Count(tblPC01.fldRDO) AS CountOffldRDO, fldRDO, fldName FROM tblPC01
WHERE fldRepMonth = '" & strRptMonth & "' GROUP BY fldRDO, fldName ORDER BY
fldName"

CurrentDb.Execute strSqlDump

----------------------------------------------------------------------------------------------
 
but it is not doing what I am telling it to do.

So, what is it doing and what do you thing you told it to do?


INSERT INTO fldTempCountByRDO (
fldCountOfRDO,
fldRDO,
fldName)
SELECT
COUNT(tblPC01.fldRDO) AS CountOffldRDO,
fldRDO,
fldName
FROM tblPC01
WHERE fldRepMonth = '" & strRptMonth & "'
GROUP BY fldRDO, fldName
ORDER BY fldName


B Wishes


Tim F
 
Back
Top