I have an SQL query that brings up the error message. I am an experienced programmer but this one has me mystified. Here is a simple copy of the SQL statement that works OK:
SELECT SalesOrderLineItems.Despatched, findWKNo([Despatched]) AS WK
FROM SalesOrderLineItems
WHERE (((SalesOrderLineItems.Despatched) Is Not Null));
Despatched is a date field and findWKNo is a function that returns the week number as an integer from the date. This statement works fine showing both the date and the week number. If I now limit the Week number to less than 53 as in the following statement I get the error message.
SELECT SalesOrderLineItems.Despatched, findWKNo([Despatched]) AS WK
FROM SalesOrderLineItems
WHERE (((SalesOrderLineItems.Despatched) Is Not Null) AND ((findWKNo([Despatched]))<53));
WK is displayed as a number but does not accept the numeric restriction.
I have tried adding the limit to WK on a second query based on the first SQL statement but it still gives the error message.
Any suggestions please?
SELECT SalesOrderLineItems.Despatched, findWKNo([Despatched]) AS WK
FROM SalesOrderLineItems
WHERE (((SalesOrderLineItems.Despatched) Is Not Null));
Despatched is a date field and findWKNo is a function that returns the week number as an integer from the date. This statement works fine showing both the date and the week number. If I now limit the Week number to less than 53 as in the following statement I get the error message.
SELECT SalesOrderLineItems.Despatched, findWKNo([Despatched]) AS WK
FROM SalesOrderLineItems
WHERE (((SalesOrderLineItems.Despatched) Is Not Null) AND ((findWKNo([Despatched]))<53));
WK is displayed as a number but does not accept the numeric restriction.
I have tried adding the limit to WK on a second query based on the first SQL statement but it still gives the error message.
Any suggestions please?