Too few parameters - Expected 1 message?

E

Eric

I'm getting the above message when trying to open the recordset. ( set rsin)

Q = DLookup("[Quarter]", "tblSettingsRentalQuarters", "[Process]= True")
QY = DLookup("[QYearProcessed]", "tblSettingsRentalQuarters", "[Process]=
True")
QEnd = DLookup("[QEndDate]", "tblSettingsRentalQuarters", "[Process]= True")

Set db = CurrentDb()

Set rsin = db.OpenRecordset("SELECT * FROM Rental_Payments_ReportData WHERE
QuarterProcessed = '" & Q & "' And [QYearProcessed] = '" & QY & "' And
[LeaseExpDate] < #" & [QEnd] & "#")

I have no idea why i'm getting this message?
Anyone knows why?
 
R

RonaldoOneNil

Are Q and QY numeric lookup values ?
If so, you do not need the single quote delimiters in your OpenRecordset
statement. Single quotes denote a text value.
 
E

Eric

Q and QY are both varchars.
Thanks

RonaldoOneNil said:
Are Q and QY numeric lookup values ?
If so, you do not need the single quote delimiters in your OpenRecordset
statement. Single quotes denote a text value.

Eric said:
I'm getting the above message when trying to open the recordset. ( set rsin)

Q = DLookup("[Quarter]", "tblSettingsRentalQuarters", "[Process]= True")
QY = DLookup("[QYearProcessed]", "tblSettingsRentalQuarters", "[Process]=
True")
QEnd = DLookup("[QEndDate]", "tblSettingsRentalQuarters", "[Process]= True")

Set db = CurrentDb()

Set rsin = db.OpenRecordset("SELECT * FROM Rental_Payments_ReportData WHERE
QuarterProcessed = '" & Q & "' And [QYearProcessed] = '" & QY & "' And
[LeaseExpDate] < #" & [QEnd] & "#")

I have no idea why i'm getting this message?
Anyone knows why?
 
D

Douglas J. Steele

Varchars? Access doesn't have a varchar data type: are you dealing with SQL
Server?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Eric said:
Q and QY are both varchars.
Thanks

RonaldoOneNil said:
Are Q and QY numeric lookup values ?
If so, you do not need the single quote delimiters in your OpenRecordset
statement. Single quotes denote a text value.

Eric said:
I'm getting the above message when trying to open the recordset. ( set
rsin)

Q = DLookup("[Quarter]", "tblSettingsRentalQuarters", "[Process]=
True")
QY = DLookup("[QYearProcessed]", "tblSettingsRentalQuarters",
"[Process]=
True")
QEnd = DLookup("[QEndDate]", "tblSettingsRentalQuarters", "[Process]=
True")

Set db = CurrentDb()

Set rsin = db.OpenRecordset("SELECT * FROM Rental_Payments_ReportData
WHERE
QuarterProcessed = '" & Q & "' And [QYearProcessed] = '" & QY & "' And
[LeaseExpDate] < #" & [QEnd] & "#")

I have no idea why i'm getting this message?
Anyone knows why?
 
E

Eric

I'm using linked SQL tables. When displaying the tables in design mode they
are of the data type text in MS ACCESS.

Douglas J. Steele said:
Varchars? Access doesn't have a varchar data type: are you dealing with SQL
Server?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Eric said:
Q and QY are both varchars.
Thanks

RonaldoOneNil said:
Are Q and QY numeric lookup values ?
If so, you do not need the single quote delimiters in your OpenRecordset
statement. Single quotes denote a text value.

:

I'm getting the above message when trying to open the recordset. ( set
rsin)

Q = DLookup("[Quarter]", "tblSettingsRentalQuarters", "[Process]=
True")
QY = DLookup("[QYearProcessed]", "tblSettingsRentalQuarters",
"[Process]=
True")
QEnd = DLookup("[QEndDate]", "tblSettingsRentalQuarters", "[Process]=
True")

Set db = CurrentDb()

Set rsin = db.OpenRecordset("SELECT * FROM Rental_Payments_ReportData
WHERE
QuarterProcessed = '" & Q & "' And [QYearProcessed] = '" & QY & "' And
[LeaseExpDate] < #" & [QEnd] & "#")

I have no idea why i'm getting this message?
Anyone knows why?


.
 
J

John Spencer

I would double check the spelling of the fields in the where clause.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I'm using linked SQL tables. When displaying the tables in design mode they
are of the data type text in MS ACCESS.

Douglas J. Steele said:
Varchars? Access doesn't have a varchar data type: are you dealing with SQL
Server?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Eric said:
Q and QY are both varchars.
Thanks

:

Are Q and QY numeric lookup values ?
If so, you do not need the single quote delimiters in your OpenRecordset
statement. Single quotes denote a text value.

:

I'm getting the above message when trying to open the recordset. ( set
rsin)

Q = DLookup("[Quarter]", "tblSettingsRentalQuarters", "[Process]=
True")
QY = DLookup("[QYearProcessed]", "tblSettingsRentalQuarters",
"[Process]=
True")
QEnd = DLookup("[QEndDate]", "tblSettingsRentalQuarters", "[Process]=
True")

Set db = CurrentDb()

Set rsin = db.OpenRecordset("SELECT * FROM Rental_Payments_ReportData
WHERE
QuarterProcessed = '" & Q & "' And [QYearProcessed] = '" & QY & "' And
[LeaseExpDate] < #" & [QEnd] & "#")

I have no idea why i'm getting this message?
Anyone knows why?

.
 
D

Daryl S

Eric -

I would also check the format of dates in SQL Server. I don't have access
to it now, but I don't think you use the # as delimeters, and you may need to
format the date you pass in based on your SQL Server date settings.

--
Daryl S


Eric said:
I'm using linked SQL tables. When displaying the tables in design mode they
are of the data type text in MS ACCESS.

Douglas J. Steele said:
Varchars? Access doesn't have a varchar data type: are you dealing with SQL
Server?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Eric said:
Q and QY are both varchars.
Thanks

:

Are Q and QY numeric lookup values ?
If so, you do not need the single quote delimiters in your OpenRecordset
statement. Single quotes denote a text value.

:

I'm getting the above message when trying to open the recordset. ( set
rsin)

Q = DLookup("[Quarter]", "tblSettingsRentalQuarters", "[Process]=
True")
QY = DLookup("[QYearProcessed]", "tblSettingsRentalQuarters",
"[Process]=
True")
QEnd = DLookup("[QEndDate]", "tblSettingsRentalQuarters", "[Process]=
True")

Set db = CurrentDb()

Set rsin = db.OpenRecordset("SELECT * FROM Rental_Payments_ReportData
WHERE
QuarterProcessed = '" & Q & "' And [QYearProcessed] = '" & QY & "' And
[LeaseExpDate] < #" & [QEnd] & "#")

I have no idea why i'm getting this message?
Anyone knows why?


.
 
D

Douglas J. Steele

That was my thought, too, but if he's using linked tables, you use Jet's
syntax, not SQL Server's.

It's only with pass-through queries that you'd use SQL Server's syntax.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Daryl S said:
Eric -

I would also check the format of dates in SQL Server. I don't have access
to it now, but I don't think you use the # as delimeters, and you may need
to
format the date you pass in based on your SQL Server date settings.

--
Daryl S


Eric said:
I'm using linked SQL tables. When displaying the tables in design mode
they
are of the data type text in MS ACCESS.

Douglas J. Steele said:
Varchars? Access doesn't have a varchar data type: are you dealing with
SQL
Server?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Q and QY are both varchars.
Thanks

:

Are Q and QY numeric lookup values ?
If so, you do not need the single quote delimiters in your
OpenRecordset
statement. Single quotes denote a text value.

:

I'm getting the above message when trying to open the recordset.
( set
rsin)

Q = DLookup("[Quarter]", "tblSettingsRentalQuarters", "[Process]=
True")
QY = DLookup("[QYearProcessed]", "tblSettingsRentalQuarters",
"[Process]=
True")
QEnd = DLookup("[QEndDate]", "tblSettingsRentalQuarters",
"[Process]=
True")

Set db = CurrentDb()

Set rsin = db.OpenRecordset("SELECT * FROM
Rental_Payments_ReportData
WHERE
QuarterProcessed = '" & Q & "' And [QYearProcessed] = '" & QY & "'
And
[LeaseExpDate] < #" & [QEnd] & "#")

I have no idea why i'm getting this message?
Anyone knows why?


.
 
V

vanderghast

The problem may be in Rental_Payments_ReportData, not in the actual query,
assuming Rental_Payments_ReportData is a query, by itself.


Vanderghast, Access MVP



Douglas J. Steele said:
That was my thought, too, but if he's using linked tables, you use Jet's
syntax, not SQL Server's.

It's only with pass-through queries that you'd use SQL Server's syntax.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Daryl S said:
Eric -

I would also check the format of dates in SQL Server. I don't have
access
to it now, but I don't think you use the # as delimeters, and you may
need to
format the date you pass in based on your SQL Server date settings.

--
Daryl S


Eric said:
I'm using linked SQL tables. When displaying the tables in design mode
they
are of the data type text in MS ACCESS.

:

Varchars? Access doesn't have a varchar data type: are you dealing
with SQL
Server?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Q and QY are both varchars.
Thanks

:

Are Q and QY numeric lookup values ?
If so, you do not need the single quote delimiters in your
OpenRecordset
statement. Single quotes denote a text value.

:

I'm getting the above message when trying to open the recordset.
( set
rsin)

Q = DLookup("[Quarter]", "tblSettingsRentalQuarters", "[Process]=
True")
QY = DLookup("[QYearProcessed]", "tblSettingsRentalQuarters",
"[Process]=
True")
QEnd = DLookup("[QEndDate]", "tblSettingsRentalQuarters",
"[Process]=
True")

Set db = CurrentDb()

Set rsin = db.OpenRecordset("SELECT * FROM
Rental_Payments_ReportData
WHERE
QuarterProcessed = '" & Q & "' And [QYearProcessed] = '" & QY &
"' And
[LeaseExpDate] < #" & [QEnd] & "#")

I have no idea why i'm getting this message?
Anyone knows why?


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top