If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
Making a query that shows a value based on another value.
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 |
#3
|
|||
|
|||
Making a query that shows a value based on another value.
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 |
#4
|
|||
|
|||
Making a query that shows a value based on another value.
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 |
Thread Tools | |
Display Modes | |
|
|