G
Guest
I have a report that is built on a query called ordersQuery. The ordersQuery
prompts for a start and end date.
I have been using the report with no problem for many years. I load our
order records into the table, run the report, the query prompts for start and
end date and the report works as expected.
Recently I loaded may 2006 data and ran the report. After entering
05/01/2006 and 05/31/2006 as the start and end date respectively, I received
the error: "the expression is typed incorrectly or it is too complex to be
evaluated..."
When I execute the underlying query, the query works perfectly. Here are
some observations for the report:
- entering the range 05/01/2006 and 05/31/2006 does not work
- entering the range 05/01/2006 and 05/04/2006 works
- entering the range 05/05/2006 and 05/05/2006 works
- entering the range 05/06/2006 and 05/31/2006 works
- entering the range 05/01/2006 and 05/06/2006 does not work
Here is the underlying query as generated by the design editor:
SELECT webOrders.ID AS ID, webOrders.DATE AS Expr3, webOrders.BILL_FNAME AS
BILL_FNAME, webOrders.BILL_LNAME AS BILL_LNAME, webOrders.SHIP_STATE AS
SHIP_STATE, webOrditems.LINE_ID AS LINE_ID, webOrditems.QUANTITY AS QUANTITY,
webOrditems.NAME AS Expr9, webOrditems.PRICE AS PRICE,
Left([weborditems]![NAME],5) AS discount, Mid([weborditems]![NAME],7) AS
stripName, IIf(InStr(LCase([NAME]),"future")>0,True,False) AS futures,
[QUANTITY]*[PRICE] AS grossPrice,
IIf([futures],[grossPrice]*0.01,[grossPrice]*0.025) AS commission,
[grossPrice]-[grossPrice]*[discount]/100 AS discGrossPrice,
IIf([futures],[discGrossPrice]*0.01,[discGrossPrice]*0.025) AS
discCommission, [grossPrice]*[discount]/100 AS discAmt,
orderQuantity.totQuant, IIf([totQuant]>=12,[discCommission],[commission]) AS
actualCommisson, IIf([discount]="00.00","Net","Dis") AS Discountable,
IIf([totQuant]>=12,[discAmt],0) AS actualDiscount, webOrders.cvtDate,
webOrditems.includeCommission, webOrders.includeCommission, webOrders.checked
FROM (webOrders INNER JOIN orderQuantity ON webOrders.ID =
orderQuantity.Expr1) INNER JOIN webOrditems ON webOrders.ID =
webOrditems.ORDER_ID
WHERE (((webOrders.cvtDate) Between [Type the beginning date:] And [Type the
ending date:]) AND ((webOrditems.includeCommission)=Yes) AND
((webOrders.includeCommission)=Yes) AND ((webOrders.checked)=Yes))
ORDER BY webOrditems.LINE_ID, webOrders.cvtDate, webOrders.DATE;
tia,
jd
prompts for a start and end date.
I have been using the report with no problem for many years. I load our
order records into the table, run the report, the query prompts for start and
end date and the report works as expected.
Recently I loaded may 2006 data and ran the report. After entering
05/01/2006 and 05/31/2006 as the start and end date respectively, I received
the error: "the expression is typed incorrectly or it is too complex to be
evaluated..."
When I execute the underlying query, the query works perfectly. Here are
some observations for the report:
- entering the range 05/01/2006 and 05/31/2006 does not work
- entering the range 05/01/2006 and 05/04/2006 works
- entering the range 05/05/2006 and 05/05/2006 works
- entering the range 05/06/2006 and 05/31/2006 works
- entering the range 05/01/2006 and 05/06/2006 does not work
Here is the underlying query as generated by the design editor:
SELECT webOrders.ID AS ID, webOrders.DATE AS Expr3, webOrders.BILL_FNAME AS
BILL_FNAME, webOrders.BILL_LNAME AS BILL_LNAME, webOrders.SHIP_STATE AS
SHIP_STATE, webOrditems.LINE_ID AS LINE_ID, webOrditems.QUANTITY AS QUANTITY,
webOrditems.NAME AS Expr9, webOrditems.PRICE AS PRICE,
Left([weborditems]![NAME],5) AS discount, Mid([weborditems]![NAME],7) AS
stripName, IIf(InStr(LCase([NAME]),"future")>0,True,False) AS futures,
[QUANTITY]*[PRICE] AS grossPrice,
IIf([futures],[grossPrice]*0.01,[grossPrice]*0.025) AS commission,
[grossPrice]-[grossPrice]*[discount]/100 AS discGrossPrice,
IIf([futures],[discGrossPrice]*0.01,[discGrossPrice]*0.025) AS
discCommission, [grossPrice]*[discount]/100 AS discAmt,
orderQuantity.totQuant, IIf([totQuant]>=12,[discCommission],[commission]) AS
actualCommisson, IIf([discount]="00.00","Net","Dis") AS Discountable,
IIf([totQuant]>=12,[discAmt],0) AS actualDiscount, webOrders.cvtDate,
webOrditems.includeCommission, webOrders.includeCommission, webOrders.checked
FROM (webOrders INNER JOIN orderQuantity ON webOrders.ID =
orderQuantity.Expr1) INNER JOIN webOrditems ON webOrders.ID =
webOrditems.ORDER_ID
WHERE (((webOrders.cvtDate) Between [Type the beginning date:] And [Type the
ending date:]) AND ((webOrditems.includeCommission)=Yes) AND
((webOrders.includeCommission)=Yes) AND ((webOrders.checked)=Yes))
ORDER BY webOrditems.LINE_ID, webOrders.cvtDate, webOrders.DATE;
tia,
jd