Solved

Access Query Help

Posted on 2014-09-21
4
253 Views
Last Modified: 2014-09-21
Hello,

I want to update the main table’s specialItem Column.
There is a [item_type] in item table that info relating to the type of item and seasonality
Logic – if the item has “Holiday” as its item_Type in the item table, then in the main table for that same item – the  column “SpecialItem” will have “Y” in it, else will “N” – so how do I run a update query in access SQL to achieve this requirement?

So for example – see the attached image
accesQuery34.accdb
0
Comment
Question by:Rayne
  • 3
4 Comments
 

Author Comment

by:Rayne
ID: 40335762
0
 

Author Comment

by:Rayne
ID: 40335763
DB attached as well
0
 
LVL 24

Accepted Solution

by:
chaau earned 500 total points
ID: 40335824
You need to use Iif function, like this:
UPDATE mainTable INNER JOIN item 
ON item.itemNumber = mainTable.item 
SET mainTable.SpecialItem = IIf(item.[item_type]="HOLIDAY","Y","N");

Open in new window

0
 

Author Comment

by:Rayne
ID: 40335925
Thank you chaau :)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This article will show you how to use shortcut menus in the Access run-time environment.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now