Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare null to string

Status
Not open for further replies.

flaviooooo

Programmer
Feb 24, 2003
496
FR
Hi,

I have 2 tables: tOrders and tOrders_import. Everyday we import orders from an external program, into the tOrders_import. This table is emptied daily. Then new orders will be added into tOrders. Also orders where the remark has changed need to be added.

To do this I link the key-field to each other. If the key isn't in tOrders, it will be added.
Then I compare the remark field in the 2 tables, and if it doesn't match the new remark is entered.

But this doesn't seem to work if the first remark is blank, and the second one isn't.

In the query this looks like:
import tOrders inner join tOrders_import on (tOrders.key = tOrders_import.key) set tOrders.remark = tOrders_import.remark where tOrders.remark <> tOrders_import.remark

How can I do this correctly?
 
Replace this:
tOrders.remark <> tOrders_import.remark
By this:
Trim(Nz(tOrders.remark)) <> Trim(Nz(tOrders_import.remark))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top