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 : Updating invoiceline custom field based on join to customer tableSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 Updating invoiceline custom field based on join to customer table 
 Author   Message 
  Jeremy 
  
 Group: Members 
 Posts: 10 
 Joined: 2006-11-01 
 Profile
 Posted : 2006-11-01 10:00:00

I want to update invoiceline records based on a value in the associated customer table.  I've searched the forum but am unable to see if the following SQL statement is possible

"update invoiceline set invoiceline.customfieldhotelchain = customer.customfieldhotelchain
from customer inner join invoiceline on customer.name = invoiceline.customerreffullname
where memo is null or memo <> 'conversion' ".  I received the error message "Unexpected extra token: from".

I've seen elsewhere in the forum one should not put the table identifier before the updated fieldname so I've tried the following statement without the table prefix (eg. "update invoiceline set customfieldhotelchain...") but with no success.

Also, I've tried the following format and different variations
"update invoiceline set customfieldhotelchain = customer.customfieldhotelchain
from
{OJ invoiceline inner join customer on (invoiceline.customerreffullname = customer.name)}
where memo is null or memo <> 'conversion' " but I receive the message "Unexpected extra token: from".  I can make this format display the correct records when it is a SELECT statement.

Any ideas as how to accomplish this update?

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-11-01 12:19:30

The approach would normally be to do a subquery next to the SET:

UPDATE Invoice SET CustomFieldContract = (Select CustomFieldContract
from Customer where FullName='Data Access Worldwide')
where CustomerRefFullName='Data Access Worldwide'

but this syntax is currently not supported in QODBC, so you will need to use:

UPDATE Invoice SET CustomFieldContract = '1234'
where CustomerRefFullName='Data Access Worldwide'

or

Update Customer Set CustomFieldContract='1234'
where FullName='Data Access Worldwide'

or

UPDATE Invoice SET CustomFieldContract = '1234-5678' where TxnId='F0A-1197683921'

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to