pervasive-sql

SQL statement with LIKE

Hello I would like to select all records that have an underscore character in their 11th character, so i try this: SELECT * FROM "BOM_SUB_LEVEL" where TOP_CODE like '%%%%%%%%%%_%%%' but this doesnt work as expected, can someone help? thanks ...

how to apply Group By to this SQL Query

Hello, I'm trying to make a list of inventory to be counted, provided the item has had a sale in the last 2 months: I'm using Pervasive SQL and it's a BusinessVision table. This query works, but I don't know how to aggregate to have one item displayed: SELECT "INVENTORY"."CODE", "INVENTORY"."INV_DESCRIPTION", "INVENTORY"."BVSTKUOM", "I...

Most efficient way to select records in one database based on result set from totally different database

I have 2 totally separate databases - one MSSQL and one Pervasive. Due to the way our product data is stored in the Pervasive database, you cannot easily run a query to get a products's information and features to display on our website. So, using a DTS package I take the product data from Pervasive and process it so it is one MSSQL t...

SQL How to find out what tables have a certain column

Is it possible to construct a query so that I can find out what tables have a partuclar column? Then if it has the column query that table for an ID number? Is this possible? ...

Improving SQL Code

I'm using Pervasive SQL. I have the following UNION of mulitple SQL statements. Is there a way to clean this up, especially the Pay Date an the Loc No fields that are selected in each statement. Is there a way to pull this out and have only one place to need to change those two fields? ( SELECT '23400' as Gl_Number, ...

Select max date row from results

Using Pervasive SQL, I have a result set: Tp_No Name State Eff_Date Actual Billed 1006 ABC TN 2006-07-01 .1 .5 1006 ABC TN 2008-02-15 .27 .6 1006 ABC TN 2010-09-01 .37 .7 1022 Widget TN 2006-07-01 ....