Decode data in Ms. Access

  • Thread starter Thread starter permana77
  • Start date Start date
P

permana77

Guest
Table:
AIN_TEST1
Coloumn/Field:
ASK
---
A
B
C
Query:
SELECT ASK FROM AIN_TEST1
Result:
ASK
----
A
B
C

But the result that I want is:
ASK
----
A
A
C

What sample of query syntax or query statement on Microsoft Access could change the data like the data above?

If I'm using Oracle Query, I would get the result from the query:
SELECT DECODE(ASK,'B','A') FROM AIN_TEST1
 
If you are using SQL use the case statement

select ask as , 'ask'=
case when ask = 'B' then 'A'
else 'ask'
end

from ain_test1

if you are usin an access query

in the field name of ask column replace ask with

askorig: iif([ask]="B","A",[ASK])

I hope the syntax is correct but I wouldn't be surprised if it Isn't
 

Users who are viewing this thread

Back
Top Bottom