Solved

Access Query Help

Posted on 2014-09-21
4
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

635 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