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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top