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: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 59 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 22:32:45 |
| Calls: | 810 |
| Calls today: | 1 |
| Files: | 1,287 |
| D/L today: |
12 files (21,036K bytes) |
| Messages: | 195,759 |