I am trying to write a query in VB6 to take from an Access table rows where month is greater than a certain figure and insert them into another table. I thought this would be more or less straightforward but I keep getting an error message i dont understand.
The query i have written is:
INSERT INTO [presreport] ([rep], [month], [existingAppts], [newBusAppts], [newBusConverted], [percentageConverted]) " & _
"SELECT [rep], [month], [existingAppts], [newBusAppts], [newBusConverted], [percentageConverted]" & _
"FROM [presentations]" & _
"WHERE [presentations].[month] >= [presMonth]"
This produces the error "too few parameters. expected 1"
I dont know what this means! I have identified that the problem lies with the variable name in the WHERE clause i.e. the presMonth. If I replace this with a figure it works fine. But this does not suit.... I need a variable, but I do not know what else I must do to make this work.
Some help to put me on the right path will be much appreciated!
Thanks.
Stuart
The query i have written is:
INSERT INTO [presreport] ([rep], [month], [existingAppts], [newBusAppts], [newBusConverted], [percentageConverted]) " & _
"SELECT [rep], [month], [existingAppts], [newBusAppts], [newBusConverted], [percentageConverted]" & _
"FROM [presentations]" & _
"WHERE [presentations].[month] >= [presMonth]"
This produces the error "too few parameters. expected 1"
I dont know what this means! I have identified that the problem lies with the variable name in the WHERE clause i.e. the presMonth. If I replace this with a figure it works fine. But this does not suit.... I need a variable, but I do not know what else I must do to make this work.
Some help to put me on the right path will be much appreciated!
Thanks.
Stuart