Update Query Basic Help Please

  • Thread starter essseeproductions
  • Start date
E

essseeproductions

Hi basically i was wondering if you could have more than 1 case in an
update query.
For example:
if field x is null then update to y however if x is not null update to
z.
Otherwise i suppose i could just create the 2 seperate queries and run
them together in a macro.
Was just wondering if it was possible to do in one query.
Many thanks in advance for your help it is appreicated.
 
E

essseeproductions

On Mar 8, 11:10 pm, [email protected] wrote:
I've got this problem now, when trying to do seperate update queries.
OK I have two tables,
The first table say "table1" has to fields "items" and "yes/no"
The second table "table" has two columns "items" and "quantity"
So i want to create two update queries..
The first "query1" will have two items "quantity" from table 2 - with
the criteria "is not null" and the second item being "yes/no" - update
to "true"
The second "query2" will have two items "quantity" from table 2 - with
the criteria "is null" and the second item being "yes/no" from table 1
- update to "false"
So basically when i run these two queries "table 2" should have some
boxes ticked with yes and some with no. However if my query just finds
1 item with a null field it changes all the items to having no tick
and vice-versa if the query finds 1 item in "table 2" with a null
field in the quantity column it will change all the columns into table
1 to having a tick.
Can anyone see where the problem is? Maybe i need too add a third
column to my query with "item" but this just gets deleted when i save
the query, or maybe its to do with relationships. Please help many
thanks.
 
E

essseeproductions

Sorry please ignore my above post i have sorted that problem.
So Karl where would i insert the IF statement, do i still need an
update query?
 
E

essseeproductions

On Mar 8, 11:42 pm, [email protected] wrote:
On trying an if statement i have replace 1 with Y and 0 with Z. I then
want a last column to add up the numbers but it comes up like this
110, instead of 1+1+0. Im entering the following
Expr1:[ifstatamentcalculationfield1]+[ifstatementcalculationfield2]+
[iftstatementcalculationfield3]
 
K

KARL DEWEY

I am completely confused because in each new post you talk about something
different.
First it was a simple update base on whether a field was null or not null.
Lastly you are discussing adding numbers (maybe).

Maybe someone can help you if you post your table structure, data example,
and what you expect the data to look like after update.
 
Top