jadams0173
Technical User
- Feb 18, 2005
- 1,210
I'm trying to update a table based off criteria from another table in one update query. My tables look like this:
TempTable:
WorkOrder Date Print Item area
1234 7/7/2006 -1 abc I
1234 7/8/2006 -1 abc P
1234 NULL 0 abc E
5678 null 0 def I
5678 NULL 0 DEF P
5678 NULL 0 DEF E
The table that I want to update has this structure:
UpdateTable
Item Area Used(checkbox)
abc I 0
abc P 0
ABC E 0
DEF I 0
DEF P 0
DEF E 0
What I would like to happen is the query update the used column to -1(true) for the item if the print column =-1. If the print column is 0 then don't make any updates to the records in update table.
The big picture is to populate a form so that it shows only the Item and the area it is used. Now the user can see all the areas for each item. But if the user doesn't print the label for a particular area for a given item, next time I won't show them the area for that item.
TempTable:
WorkOrder Date Print Item area
1234 7/7/2006 -1 abc I
1234 7/8/2006 -1 abc P
1234 NULL 0 abc E
5678 null 0 def I
5678 NULL 0 DEF P
5678 NULL 0 DEF E
The table that I want to update has this structure:
UpdateTable
Item Area Used(checkbox)
abc I 0
abc P 0
ABC E 0
DEF I 0
DEF P 0
DEF E 0
What I would like to happen is the query update the used column to -1(true) for the item if the print column =-1. If the print column is 0 then don't make any updates to the records in update table.
The big picture is to populate a form so that it shows only the Item and the area it is used. Now the user can see all the areas for each item. But if the user doesn't print the label for a particular area for a given item, next time I won't show them the area for that item.