Link to home
Start Free TrialLog in
Avatar of andyb7901
andyb7901

asked on

IIF statement in SQL

Hi,
I have a query which I need to complete an If statment in the middle. At the moment I have

 IIf([tbl_adequacy_list.dox_fsa] = 0,False,True)

What I would like is for it to say if dox_fsa = True return Yes, otherwise return No; My query is;

INSERT INTO tbl_spn_finalised ( spn_id, spn_long_name, kyc_status, fsa, aml, aof, sub_acct, note_aof_live, notes_aof_archive, date_added )
SELECT tbl_SPNLookup.F1, tbl_adequacy_list.spn_name_a, tbl_kyc_status.kyc_status_name, IIf([tbl_adequacy_list.dox_fsa] = 0,False,True), tbl_adequacy_list.dox_aml, tbl_adequacy_list.dox_aof, tbl_adequacy_list.dox_sub_acct, tbl_adequacy_list.notes_aof_live, tbl_adequacy_list.notes_aof_archive, tbl_adequacy_list.date_added
FROM tbl_SPNLookup INNER JOIN (tbl_kyc_status INNER JOIN tbl_adequacy_list ON tbl_kyc_status.status_id = tbl_adequacy_list.kyc_statis_id) ON tbl_SPNLookup.F1 = tbl_adequacy_list.spn_id
ORDER BY tbl_SPNLookup.F1;
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andyb7901
andyb7901

ASKER

What is dox_fsa is a yes no field? Would that makea a difference?
what type of data is field fsa on tbl_spn_finalised? is it text or Yes/No field?
<What if dox_fsa is a yes no field?>  Yes/No field = 0 is always false/No