Invalid Procedure Call
Hello,
This query returns an "Invalid Procedure Call" error because of the Len function:
SELECT DISTINCTROW tbl_Launch_L.CO_NUMBER, tbl_Launch_L.FRT_CHG_CD, tbl_Launch_L.Ship_Via, tbl_Launch_L.Ship_Via_Code
FROM tbl_Launch_L INNER JOIN tbl_ShippingCodes_L ON tbl_Launch_L.Ship_Via_Code = tbl_ShippingCodes_L.CODE
WHERE (((tbl_Launch_L.FRT_CHG_CD)='2') AND ((tbl_Launch_L.Ship_Via) Like '*:*') AND ((tbl_ShippingCodes_L.Type)='N') AND ((tbl_ShippingCodes_L.Required)='Y') AND ((IsNumeric(Right([SHIP_VIA],Len([SHIP_VIA])-4)))<>1))
ORDER BY tbl_Launch_L.CO_NUMBER;
This query works perfectly when I hard code the length:
SELECT DISTINCTROW tbl_Launch_L.CO_NUMBER, tbl_Launch_L.FRT_CHG_CD, tbl_Launch_L.Ship_Via, tbl_Launch_L.Ship_Via_Code
FROM tbl_Launch_L INNER JOIN tbl_ShippingCodes_L ON tbl_Launch_L.Ship_Via_Code = tbl_ShippingCodes_L.CODE
WHERE (((tbl_Launch_L.FRT_CHG_CD)='2') AND ((tbl_Launch_L.Ship_Via) Like '*:*') AND ((tbl_ShippingCodes_L.Type)='N') AND ((tbl_ShippingCodes_L.Required)='Y') AND ((IsNumeric(Right([SHIP_VIA],Len(13-4)))<>1))
ORDER BY tbl_Launch_L.CO_NUMBER;
There is no ship_via value in my table with a length of less than 13 - so it never returns a negative number. I'm stumped. Can anyone help??!!
Thanks,
D
|