Solved

Access Query Help

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
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…

705 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

11 Experts available now in Live!

Get 1:1 Help Now