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

  • Thread starter Thread starter james
  • Start date Start date
J

james

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
 
Remove the BuySell column from your query and replace with this in the field
Row

RHS or LHS: IIF([BuySell]="Buy","RHS","LHS)
 
Worked a treat. Thanks for the help.

RonaldoOneNil said:
Sorry missed the closing quote

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

james said:
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
 
Back
Top