Making a query that shows a value based on another value.

Hi
I have a Query that extracts two fields of data from a table
1. CustomerName (Contains customer name)
2. BuySell (Has either the Word "Buy" or "Sell")

However I wish this query to display CustomerName (As above) but I want it 
to display a word based on whether field 2 is the word 'Buy' or the word 
'Sell'. So for example if the word 'Buy' is in field 2 then I want the word 
'RHS' to be displayed and if the word 'Sell' is in field 2 I want the word 
'LHS' to be displyed. I do not need this to save into a table just purely for 
looking at in the query.

Is this possible?

Thanks
James
0
Utf
11/19/2009 10:14:04 AM
access.queries 6343 articles. 1 followers. Follow

3 Replies
826 Views

Similar Articles

[PageSpeed] 47

Remove the BuySell column from your query and replace with this in the field 
Row

RHS or LHS: IIF([BuySell]="Buy","RHS","LHS)

"james" wrote:

> Hi
> I have a Query that extracts two fields of data from a table
> 1. CustomerName (Contains customer name)
> 2. BuySell (Has either the Word "Buy" or "Sell")
> 
> However I wish this query to display CustomerName (As above) but I want it 
> to display a word based on whether field 2 is the word 'Buy' or the word 
> 'Sell'. So for example if the word 'Buy' is in field 2 then I want the word 
> 'RHS' to be displayed and if the word 'Sell' is in field 2 I want the word 
> 'LHS' to be displyed. I do not need this to save into a table just purely for 
> looking at in the query.
> 
> Is this possible?
> 
> Thanks
> James
0
Utf
11/19/2009 10:39:01 AM
Sorry missed the closing quote

RHS or LHS: IIF([BuySell]="Buy","RHS","LHS")

"james" wrote:

> Hi
> I have a Query that extracts two fields of data from a table
> 1. CustomerName (Contains customer name)
> 2. BuySell (Has either the Word "Buy" or "Sell")
> 
> However I wish this query to display CustomerName (As above) but I want it 
> to display a word based on whether field 2 is the word 'Buy' or the word 
> 'Sell'. So for example if the word 'Buy' is in field 2 then I want the word 
> 'RHS' to be displayed and if the word 'Sell' is in field 2 I want the word 
> 'LHS' to be displyed. I do not need this to save into a table just purely for 
> looking at in the query.
> 
> Is this possible?
> 
> Thanks
> James
0
Utf
11/19/2009 10:40:03 AM
Worked a treat. Thanks for the help.

"RonaldoOneNil" wrote:

> Sorry missed the closing quote
> 
> RHS or LHS: IIF([BuySell]="Buy","RHS","LHS")
> 
> "james" wrote:
> 
> > Hi
> > I have a Query that extracts two fields of data from a table
> > 1. CustomerName (Contains customer name)
> > 2. BuySell (Has either the Word "Buy" or "Sell")
> > 
> > However I wish this query to display CustomerName (As above) but I want it 
> > to display a word based on whether field 2 is the word 'Buy' or the word 
> > 'Sell'. So for example if the word 'Buy' is in field 2 then I want the word 
> > 'RHS' to be displayed and if the word 'Sell' is in field 2 I want the word 
> > 'LHS' to be displyed. I do not need this to save into a table just purely for 
> > looking at in the query.
> > 
> > Is this possible?
> > 
> > Thanks
> > James
0
Utf
11/19/2009 11:06:06 AM
Reply:

Similar Artilces:

2003 Recovery Storage Group Query
Can anyone confirm for me if it is ok to mount your live main storage group as your recovery storage group on another exchange server? On Mon, 24 Oct 2005 06:03:03 -0700, Colin Graham <ColinGraham@discussions.microsoft.com> wrote: >Can anyone confirm for me if it is ok to mount your live main storage group >as your recovery storage group on another exchange server? If they are in same admin group, you should be able to. thanks Andy - will there be any impact on performance on the live server mate? "Andy David - MVP" wrote: > On Mon, 24 Oct 2005 06:03:03 -0700...

Append query bloat
I have an access database where I use an append query quite often. I will use this same query over and over by changing the table I'm appending from, then I save the query. During the save process, the database bloats from ~50KB to ~150KB. Our company recently upgraded to 2007 and that is when I noticed the problem. Is there a way to stop this from happening? I can manage it by compacting and repairing after each save, but recently I added 4 tables in one day, so this was a pain. Thanks Don't even worry about it. An Access file can be up to 2 GB in size. 150 KB ...

show total number of items in Inbox and Sent Items
My Outlook 2002 used to show (somewhere on the bottom of the screen) the total number of items in the folder that was highlighted, if the folder was "Inbox" or "Sent Items". This was helpful because I try to keep the number of items pretty low. Somehow (updates, patches, our IT person???) this function has disappeared. Any ideas on getting it back? Thanks ...

Make Default
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Email Client: Exchange Hi I have a script to open entourage to configure a account, although the first time round for every user the script stops due to the message in Entourage asking would you like to make entourage you default browser. <br> Anyone have a script to set this to default or any way of setting this so it never ask's ? <br><br>thanks This is a multi-part message in MIME format. ----------------709806166701805979 Content-Type: text/plain; charset=iso-8859-1; format=flowed C...

V-Lookup variation query
Hi, I am having an issue with comparing columns of values. Basically I have a table similar to the below except with a couple of thousand lines. Either the first column will have a value that doesn't match with the second column or vice versa so basically I need Excel (2002) to begin at the top and compare the values until it finds a mis-match, extract that value (perhaps to another sheet) and continue down the columns doing the same thing until the end. 46,898,748.00 46,898,800.00 2,365,412.00 2,365,412.00 15,465.00 15,465.00 4,864.00 ...

Making a Pivot chart from 3 differnt sets of data / worksheets.
Hi, I have 2 workshsheets of data with a list of delivery dates of about 10 different products over the last 3 years, (i cant combine these to just 1 worksheet for other separate reasons) and a 3rd worksheet with a column of the same products and dates that some of these products became faulty and were sent back to me . On a 4th worksheet, I am trying to do a graph that looks at the 3 worksheets and plots pivot table of dates and amount of each product deliveries & returned to me. So as i select ,say, product A from that pivot list, it produces a graph for these 3 variables (dat...

Query Server for all Email address
Hi all, Is there away to query my Exchnage server 2003 to list all email address. Thanks On Mon, 31 Oct 2005 06:25:02 -0800, Sam NetAdmin <SamNetAdmin@discussions.microsoft.com> wrote: >Hi all, >Is there away to query my Exchnage server 2003 to list all email address. > >Thanks ldifde http://support.microsoft.com/kb/q237677/ adfind ( you can google that) and others... "Sam NetAdmin" <SamNetAdmin@discussions.microsoft.com> wrote in message news:706D04B2-196E-4C00-B9AE-C6157C69122A@microsoft.com... > Hi all, > Is there away to query my Exchnage...

making a transfer show up in the budget
Hi all. I am running MS money 2006. How do I make a transfer show up in my budget? I have several liabilities and credit cards, and I would like to make a budget with the monthly amount owed to each creditor showing up in my budget. The MS Money 2006 standard program does not allow me, as far as I can tell, to make a monthly transfer to a credit card or liability show up in my budget, unless I make it a category. Any help with this is much appreciated. thanks See http://umpmfaq.info/faqdb.php?q=124 for the short answer. You may be more interested in "cash flow" than &qu...

making tickets
what is the best way to make numbered tickets using Publisher 2002? Hi lc (rconnell@numail.org), in the Microsoft Office Publisher newsgroup you posted: || what is the best way to make numbered tickets using || Publisher 2002? Check out the following link: http://www.mvps.org/publisher/numbering1.html -- Brian Kvalheim Microsoft Office Publisher MVP Official Publisher MVP Site: http://www.kvalheim.org This posting is provided "AS IS" with no warranties, and confers no rights. >-----Original Message----- >what is the best way to make numbered tickets using >Publi...

Show buttons on one row grayed out
I am using OL 2003 and trying to customize it a bit. When I clicked the arrow at the end of the standard toolbar. I noticed the option to "Show buttons on one row". Unfortunately, I also noticed that it was grayed out, and unuseable. Both rows buttons could easily fit on one row. Could somebody tell me how to make use of the option to show them on one row? Thanks. Sorry, I was wanting it to put the standard toolbar and the advanced toolbar on the same row. I have now added most of the items of the advanced toolbar to the standard bar. That did the trick. "Bob S" ...

How make a favorite for all users in Ex2007/OWA/Documents area?
I am playing around with OWA in 2007 and exploring the "documents" feature of OWA that allows users to view Windows file shares by UNC. There is the individual "add to favories" option, but does anyone know of a way to administratively specify a favorite for all users? The alternative seems to be logon as each user to setup the same favorite--surely that is not the only way? Thanks for any help! Evan ...

Reversing name values in a field
Hi, I have a field called CustomerName that has values that are last name, first name. So there is a value of Smith, John which is John Smith. I want to preserve the value in this field but create a new field called CustomerName1 that has John Smith in it. It would need to somehow reverse the values based on the comma delimeter and then get rid of the comma. Can someone help? Thanks, -- Chuck W LN = Left$(CustomerName, InStr(CustomerName, ",") - 1) FN = Right$(CustomerName, Len(CustomerName) - InStr(CustomerName, ",")) -Dorian "ChuckW" wrote:...

How do you change cells with formula's to the value or text?
In lotus it is possible to change the formula in a cell to the text or the number that that formula returns. Of course, you can not reverse it, but in is very helpful sometimes. Is that possible in Excel CTRL + ~ will toggle between formulas and values -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL2K & XLXP ---------------------------------------------------------------------------- Attitude - A little thing that makes a BIG difference ----------------------------------------------------------------------------...

Msn not showing emoticons
I checked the box in the customisation window, i checked it so i can see emoticons, but yet i still cant. i tried restarting the computer, but it still didnt work. Anyone help? Greetings, What exactly are you seeing instead? For instance, are you seeing the textual equivalent, like :)? Or are you getting a blank white area or what? Additionally, are these custom emoticons or the built-in ones? -- Jonathan Kay Microsoft MVP - Windows Live Messenger MSN Messenger/Windows Messenger MessengerGeek Blog: http://www.messengergeek.com Messenger Resources: http://messenger.jona...

AN OPPORTUNITY TO MAKE $$$
THIS REALLY WORKS IF YOU FOLLOW THROUGH!!! MAKE MONEY!!! MAKE MONEY!!! MAKE THOUSANDS OF "$$$" !!! I found this "NETWORKING PROJECT" on a bulletin board and decided to try it: All I say is, it "WORKS". All it takes is a small INVESTMENT of your "TIME" AND "less than $10.00"! INTERESTED??? E-mail: "spotty3443@yahoo.com" for DETAILS. ...

How do I make the X-Axis increase in scale with the quantity?
For example: If I have the values 1.5, 3.5, 8.7, 9.9 in the x values for a line graph, is there anyway to make them spaced apart so that they are in scale with eachother... Like so the distance between 3.5 and 8.7 is larger than, the distance between 1.5 and 3.5? Create a XY Scatter chart. It, and a bubble chart, are the only 2 that allow for cardinals values on the x axis. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <F2D3DC58-86D3-4D21-9D57-F704A78941FB@microsoft.com>, =?Utf- 8...

how do you make all incoming emails bold?
"Beth" <Beth@discussions.microsoft.com> wrote in message news:CD76AE42-9EC9-44C8-90FB-3A0566671AC4@microsoft.com... > I could've sworn there was a message here, but when I looked the body was completely blank. Oh well, guess the poster really didn't want to ask a question. how do you make all incoming emails bold? "Vanguard (NPI)" wrote: > "Beth" <Beth@discussions.microsoft.com> wrote in message > news:CD76AE42-9EC9-44C8-90FB-3A0566671AC4@microsoft.com... > > > > > I could've sworn there was a messag...

Multiple Joins in a Query Design
I am a novice with Access and am stumped on a query design. I have a database with two tables. The first table has closing prices for various stocks and the structure looks like such: Ticker Date Price C 1/4/10 3.4 C 1/5/10 3.53 C 1/6/10 3.64 YHOO 1/4/10 17.10 YHOO 1/5/10 17.23 YHOO 1/6/10 17.17 I have another table that looks like this: Ticker Date1 Date2 C 1/5/10 1/6/10 YHOO 1/4/10 1/5/10 I want to build a query that will join the price when the dates and tickers match in both tables. It would end up like this: Ticker Date1 Date2 C 3.53 3.64 YHOO 17...

How to make VLOOKUP work for this
I have a "master" spreadsheet where column A is a time column and every row represents a second (in plain text format) such as 00:00, 00:01, 00:02.... 00:59:, 01:00, 01:01, 01:02,... and continues on for 24 minutes... 23:59, 24:00. (1442 rows). Off to the side (I'm thinking of putting it on another sheet though) I have a small table where I'll enter the time and corresponding data I need populated in Column B, and will look something like the following example; My question(s) are, is the VLOOKUP function the best way to populate column B with the values? It's ...

Sum of multiple numbers from query
I've got 3 fields that the user will put the numbers in I want to get a total of all 3 fields. field names: ReExp AvoidNumb AutoArousal total field: TotalPSS-SR need help how do I make the query work? Kim Add an additional field to your query: [TotalPSS-SR] = [ReExp] + [AvoidNumb] + [AutoArousal] "Kim T" wrote: > I've got 3 fields that the user will put the numbers in I want to get a total > of all 3 fields. > field names: > ReExp > AvoidNumb > AutoArousal > > total field: TotalPSS-SR > need help how do I make the query work? > Kim ...

How do I make more than 12 entries in excel balance sheet templat.
The excel balance sheet template is exactly what I need. How do I get it to expand to an infinite number of entries?? office xp ...

Linq Query and Lambda
Hello, I am getting a list of regions as follows: return _context.Regions.Select(r => new RegionModel { Id = r.Id, Name = r.Name }).OrderBy(r => r.Name).AsQueryable(); However I need to get only the Regions which are related with Centers. So I need to check _context.Centers and get all used Regions Ids from each Center.Region.Id and then get all the Regions with those Ids ... Is this possible to do with a lambda expression ... I think it is possible but I am a little bit confused on this. Thank You, Miguel shapper wrote: > Hello...

sending mail from another user's inbox as that user
How can make a user access another user's inbox, but have the person send mail as the owner's name? The permissions on this have to be set on the Exchange Server. See the following Knowledge Base article. http://support.microsoft.com/default.aspx?scid=kb; [LN];Q327000 The end user that will be sending the message will also want to make sure to select the "From field" in the New message view. You may also have to set up Delegate Access on the Outlook client. (Tools, Options, Delegates) >-----Original Message----- >How can make a user access another user's...

Make Personal Calendar Read Only
I would like to make a users personal calendar read-only to the user. The individuals calendar is delegated to about 5 others and they need full access, but I do not want the end-user to have full access but read only. How do I go about changing these permissions? Thanks, Brian I don't believe that is even possible through the standard means, it is a little bizarre. You may be able to do it through a tool like ADSIEdit. Nue "HoosierDaddy" <bjorgenson@charter.net> wrote in message news:1139250053.396235.106790@o13g2000cwo.googlegroups.com... >I would like to make a...

Outlook 2003 Calendar
Boss and secretary. Secretary takes a new job elsewhere. Secretary's account was disabled and deleted according to our normal procedures. For some reason, every time the boss has an appointment or meeting scheduled by her new secretary (or anyone else for that matter), we get bounce back message saying that the former secretary's email cannot be found. Below is the exact message: <<<<<<**********<<<<<<< Your message did not reach some or all of the intended recipients. Subject: Test date for ****** (former secretary) Sent: 4/7/20...