I have used the sql statement in Access 97 but now I am using 2016 and I keep getting the old "not enough parameters". I have check everything and all seems well. can anyone throw any light on the problem. I'm new to SQL
TIA - Ray
strSql = "SELECT FarNorth.JPID, FarNorth.FirstName, FarNorth.Surname, FarNorth.Email, FarNorth.Status, Sub2.SubID, Sub2.Year, Sub2.AmountPaid" & _
"FROM FarNorth INNER JOIN Sub2 ON FarNorth.JPID = Sub2.SubID " & _
"WHERE (((FarNorth.Status)='Active') AND ((Sub2.Year)=2022) AND ((Sub2.AmountPaid) Is Null) AND ((Len([FarNorth].[Email]))>0));"
Ray Pearson presented the following explanation :Thank you Ron.....I followed-up on your advice to enter the sql in to a query and presto the error was staring me in the face. Thanks again - Ray
I have used the sql statement in Access 97 but now I am using 2016 and I keep
getting the old "not enough parameters". I have check everything and all seems well. can anyone throw any light on the problem. I'm new to SQL
TIA - Ray
strSql = "SELECT FarNorth.JPID, FarNorth.FirstName, FarNorth.Surname, FarNorth.Email, FarNorth.Status, Sub2.SubID, Sub2.Year, Sub2.AmountPaid" & _I do not see anything obviously wrong with the Sql you have listed, but
"FROM FarNorth INNER JOIN Sub2 ON FarNorth.JPID = Sub2.SubID " & _
"WHERE (((FarNorth.Status)='Active') AND ((Sub2.Year)=2022) AND ((Sub2.AmountPaid) Is Null) AND ((Len([FarNorth].[Email]))>0));"
we cannot see what columns are in the tables FarNorth and Sub2.
Presumbly :
FarNotrh.Status is a Text type
Sub2.Year is a number
Sub2AmountPaid does not have a Default Value and
FarNorth.Email is also a text type.
I'd reccomend you taking the Sql and Paste it into the Sql view of a
new query, and see if Access gives you a hint as to where the problem
might be.
Ron W
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 53:38:49 |
Calls: | 6,650 |
Calls today: | 2 |
Files: | 12,200 |
Messages: | 5,330,494 |