Solved

Access Query Help

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

Windows running painfully slow? Try these tips..

Stay away from Speed Up Computer Programs that do more harm than good.
Try these tips instead.
Step by step instructions in trouble shooting Windows Performance issues.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

752 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