S
seeker
The following sql code gives the familiar error found in the subject line.
PARAMETERS [forms]![frmdaterangeforledgerreport]![txtstartdate] DateTime,
[forms]![frmdaterangeforledgerreport]![txtenddate] DateTime;
SELECT TRANSACTIONS.[TRA:TRANSTYPE], TRANSACTIONS.[TRA:NUMBER],
TRANSACTIONS.[TRAATE], TRANSACTIONS.[TRA:TOWHOM],
TRANSACTIONS.[TRA:AMOUNT], TRANSACTIONS.[TRA:ACCTBAL],
TRANSACTIONS.[TRA:CODING]
FROM TRANSACTIONS
WHERE
(((TRANSACTIONS.[TRAATE])>=[Forms]![frmDateRangeforledgerreport]![txtStartDate]
And
(TRANSACTIONS.[TRAATE])<=[Forms]![frmDateRangeforledgerreport]![txtEndDate]))
OR (((TRANSACTIONS.ID) In ("select min([id]) -1 from transactions where
[tra:date] >=# " & [Forms]![frmDateRangeforledgerreport]![txtStartDate] & "#
And <= #" & [Forms]![frmDateRangeforledgerreport]![txtEndDate] & "#"))) OR
(((TRANSACTIONS.ID) In ("select max([id]) +1 from transactions where
[tra:date] >= #" & [Forms]![frmDateRangeforledgerreport]![txtStartDate] & "#
And <= #" & [Forms]![frmDateRangeforledgerreport]![txtEndDate] & "#")));
I have the parameters in the parameter box. Thanks.
PARAMETERS [forms]![frmdaterangeforledgerreport]![txtstartdate] DateTime,
[forms]![frmdaterangeforledgerreport]![txtenddate] DateTime;
SELECT TRANSACTIONS.[TRA:TRANSTYPE], TRANSACTIONS.[TRA:NUMBER],
TRANSACTIONS.[TRAATE], TRANSACTIONS.[TRA:TOWHOM],
TRANSACTIONS.[TRA:AMOUNT], TRANSACTIONS.[TRA:ACCTBAL],
TRANSACTIONS.[TRA:CODING]
FROM TRANSACTIONS
WHERE
(((TRANSACTIONS.[TRAATE])>=[Forms]![frmDateRangeforledgerreport]![txtStartDate]
And
(TRANSACTIONS.[TRAATE])<=[Forms]![frmDateRangeforledgerreport]![txtEndDate]))
OR (((TRANSACTIONS.ID) In ("select min([id]) -1 from transactions where
[tra:date] >=# " & [Forms]![frmDateRangeforledgerreport]![txtStartDate] & "#
And <= #" & [Forms]![frmDateRangeforledgerreport]![txtEndDate] & "#"))) OR
(((TRANSACTIONS.ID) In ("select max([id]) +1 from transactions where
[tra:date] >= #" & [Forms]![frmDateRangeforledgerreport]![txtStartDate] & "#
And <= #" & [Forms]![frmDateRangeforledgerreport]![txtEndDate] & "#")));
I have the parameters in the parameter box. Thanks.