Update several fields and compare strings (1 Viewer)

gasbored

Registered User.
Local time
Today, 05:18
Joined
Jul 30, 2007
Messages
12
Have devloped a database to log all support issues for an application I work with.

I periodically update the database by importing from another database

for example my main table tbl_issues has fields IR_NO, DESCRIPTION and STATUS

I then import data from tbl_import which also has these fields. The following query works fine:

UPDATE tbl_support
SET tbl_support.STATUS = tbl_import.STATUS
WHERE tbl_support.STATUS <> tbl_import.STATUS
AND tbl_support.IR_NO = tbl_import.IR_NO

However I also want to do this at the same time:

UPDATE tbl_support
SET tbl_support.DESCRIPTION = tbl_import.DESCRIPTION
WHERE tbl_support.DESCRIPTION <> tbl_import.DESCRIPTION
AND tbl_support.IR_NO = tbl_import.IR_NO

How do I update both fields at the same time?
 

Guus2005

AWF VIP
Local time
Today, 13:18
Joined
Jun 26, 2007
Messages
2,645
Code:
UPDATE tbl_support
SET tbl_support.STATUS = tbl_import.STATUS,
tbl_support.DESCRIPTION = tbl_import.DESCRIPTION
WHERE tbl_support.STATUS <> tbl_import.STATUS
AND tbl_support.IR_NO = tbl_import.IR_NO
From the Access Help file:
Code:
UPDATE Orders
SET OrderAmount = OrderAmount * 1.1,
Freight = Freight * 1.03
WHERE ShipCountry = 'UK';
So next time try F1 for a change:D
 

gasbored

Registered User.
Local time
Today, 05:18
Joined
Jul 30, 2007
Messages
12
Thanks

Help is great but you have to choose your search criteria carefully. That's why a forum like this is so useful.

Thanks again for your help
 

Users who are viewing this thread

Top Bottom