Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Problem using "where ... In ( )" with more than one entrySearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC SQL Support Forum

 New Topic 
 
 Post Reply 
[1]  
 Problem using "where ... In ( )" with more than one entry 
 Author   Message 
  BCubed 
  
 Group: Members 
 Posts: 2 
 Joined: 2006-05-03 
 Profile
 Posted : 2006-05-03 04:02:21

The following query was working under QODBC v.5,

SELECT SalesOrderLine.RefNumber SO,
       SalesOrderLine.PONumber PO,
       SalesOrderLine.ShipAddressAddr1 ST_NAME,
       SalesOrderLine.ShipAddressAddr2 ST_AD1,
       SalesOrderLine.ShipAddressAddr3 ST_AD2,
       SalesOrderLine.ShipAddressCity ST_CITY,
       SalesOrderLine.ShipAddressState ST_ST,
       SalesOrderLine.ShipAddressPostalCode ST_ZIP,
       SalesOrderLine.ShipMethodRefFullName SHIPVIA,
       SalesOrderLine.FOB,
       SalesOrderLine.DueDate,
       SalesOrderLine.SalesOrderLineSeqNo,
       SalesOrderLine.SalesOrderLineItemRefFullName ITEM,
       SalesOrderLine.SalesOrderLineDesc,
       SalesOrderLine.SalesOrderLineQuantity QTY
FROM SalesOrderLine
WHERE (SalesOrderLine.RefNumber IN ('2543', '2544', '2547')
        AND (SalesOrderLine.SalesOrderLineQuantity > 0
          OR SalesOrderLine.SalesOrderLineItemRefFullName = '999'))
ORDER BY SalesOrderLine.RefNumber, SalesOrderLine.SalesOrderLineSeqNo

Now with v.6 it returns no records matched and only works if I try to match a single Sales Order

i.e. SalesOrderLine.RefNumber IN ('2543')

Has the syntax changed with v.6?

 

 
Barry 
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-05-03 08:41:18

Curious, the no records matched comes out from the QODBC v6 optimizer. To workaround this problem, simply add the unoptimized tag to run the query in v5 mode:

SELECT SalesOrderLine.RefNumber SO,
       SalesOrderLine.PONumber PO,
       SalesOrderLine.ShipAddressAddr1 ST_NAME,
       SalesOrderLine.ShipAddressAddr2 ST_AD1,
       SalesOrderLine.ShipAddressAddr3 ST_AD2,
       SalesOrderLine.ShipAddressCity ST_CITY,
       SalesOrderLine.ShipAddressState ST_ST,
       SalesOrderLine.ShipAddressPostalCode ST_ZIP,
       SalesOrderLine.ShipMethodRefFullName SHIPVIA,
       SalesOrderLine.FOB,
       SalesOrderLine.DueDate,
       SalesOrderLine.SalesOrderLineSeqNo,
       SalesOrderLine.SalesOrderLineItemRefFullName ITEM,
       SalesOrderLine.SalesOrderLineDesc,
       SalesOrderLine.SalesOrderLineQuantity QTY
FROM SalesOrderLine unoptimized
WHERE (SalesOrderLine.RefNumber IN ('2543', '2544', '2547')
        AND (SalesOrderLine.SalesOrderLineQuantity > 0
          OR SalesOrderLine.SalesOrderLineItemRefFullName = '999'))
ORDER BY SalesOrderLine.RefNumber, SalesOrderLine.SalesOrderLineSeqNo

I've added this problem to our bug list.

 

  Top 
  BCubed 
  
 Group: Members 
 Posts: 2 
 Joined: 2006-05-03 
 Profile
 Posted : 2006-05-04 06:13:23

Our application is actually returning the "No records matched" message it does this when an empty set is returned - sorry for any confusion.

I tried to add the "unoptimized" after "From SalesOrderLine"

Now I get the following error message:

General SQL error.
[QODBC] Column not found: RefNumber.