SQL

19 views
Skip to first unread message

Ray Pearson

unread,
May 21, 2021, 7:59:16 PMMay 21
to
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));"

Ron Weiner

unread,
May 21, 2021, 9:33:44 PMMay 21
to
Ray Pearson presented the following explanation :
I do not see anything obviously wrong with the Sql you have listed, but
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

Ray Pearson

unread,
May 29, 2021, 7:26:19 PMMay 29
to
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
Reply all
Reply to author
Forward
0 new messages