Solved

Access Query Help

Posted on 2014-09-21
4
259 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 25

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

680 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