DAO SQL COUNT SYNTAX

M

Mary

I am getting a parameter error. I thought, I have a
syntax error, tried many things, nothing works.
Can someone check this for me.
The error is
Too few Parameters. Expected 1.:3061

strSQL = "SELECT CLIENT_NAME, CLNT_ID," _
& " COUNT(Forecast_Date) AS CountOfForecast_Date " _
& " FROM tblFINAL_FORECAST GROUP BY CLIENT_NAME, CLNT_ID;"

Set rsMCT = CurrentDb.OpenRecordset(strSQL)

What am I doing wrong. I don't have any parameters in my
statements, or I think it the syntax,

Thank you in advance.
 
D

Dirk Goldgar

Mary said:
I am getting a parameter error. I thought, I have a
syntax error, tried many things, nothing works.
Can someone check this for me.
The error is
Too few Parameters. Expected 1.:3061

strSQL = "SELECT CLIENT_NAME, CLNT_ID," _
& " COUNT(Forecast_Date) AS CountOfForecast_Date " _
& " FROM tblFINAL_FORECAST GROUP BY CLIENT_NAME, CLNT_ID;"

Set rsMCT = CurrentDb.OpenRecordset(strSQL)

What am I doing wrong. I don't have any parameters in my
statements, or I think it the syntax,

Check for a misspelled field or table name.
 
D

Dan Artuso

Hi,
Does the very same SQL statement work in the query designer?
Try it and see.
 
Top