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. 

  • 0 in reply to jcnichols

    Thanks Jcnichols. I'm not really interested in the "Stuff" part of the issue, that's just to keep the example simple.

    Here's what I want:

    SELECT *

    FROM (SELECT ItemCode, SUM(QuantityOnHand WHERE WarehouseCode='100') AS OnHand GROUP BY ItemCode) as INV

    For my own reasons.

    I know I can do this independently, without nesting it, but I should be able to run this script.

  • 0 in reply to Justin Langdon

    Sage 100 Advanced does not have a SQL server back end (it uses a file based data storage format called Providex), so the full SQL language is not implemented.  You get what the Providex ODBC driver supports... and it does what it does.

    If there is something you can't figure out a work-around for, ask.  There are techniques commonly used to get around the driver's limitations.

Reply
  • 0 in reply to Justin Langdon

    Sage 100 Advanced does not have a SQL server back end (it uses a file based data storage format called Providex), so the full SQL language is not implemented.  You get what the Providex ODBC driver supports... and it does what it does.

    If there is something you can't figure out a work-around for, ask.  There are techniques commonly used to get around the driver's limitations.

Children