SQL - Nested Queries?

SUGGESTED

I'm new to Sage, using 100 Advanced.

For SQL, why doesn't this script work:

SELECT *

FROM (SELECT ItemCode, QuantityOnHand WHERE Warehouse="100" FROM ItemWarehouse) AS STUFF

Please disregard spelling errors (if any). I've used this style of syntax in the past and it worked fine. But in Sage I keep getting an error.

I have the same issue with CASE statements. Even basic ones don't seem to work.

I also cannot do this:

SELECT LEFT(ItemCode,1) AS STUFF

FROM CI_Item

I could use some help, if anyone could steer me in the right direction.

Thanks,

Parents
  • 0

    Hi, Try the following

    SELECT ItemCode AS "Stuff", QuantityOnHand AS "Quantity of Stuff"
    FROM IM_ItemWarehouse
    WHERE WarehouseCode='100'

    See the ODBC driver guide 

    CASE statements are not supported in the Providex ODBC driver from Sage.

    They are supported in the version of the driver from PVX PLUS.

    John Nichols

    Sage. 

Reply
  • 0

    Hi, Try the following

    SELECT ItemCode AS "Stuff", QuantityOnHand AS "Quantity of Stuff"
    FROM IM_ItemWarehouse
    WHERE WarehouseCode='100'

    See the ODBC driver guide 

    CASE statements are not supported in the Providex ODBC driver from Sage.

    They are supported in the version of the driver from PVX PLUS.

    John Nichols

    Sage. 

Children