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_ao f_live, tbl_adequacy_list.notes_ao f_archive, tbl_adequacy_list.date_add ed
FROM tbl_SPNLookup INNER JOIN (tbl_kyc_status INNER JOIN tbl_adequacy_list ON tbl_kyc_status.status_id = tbl_adequacy_list.kyc_stat is_id) ON tbl_SPNLookup.F1 = tbl_adequacy_list.spn_id
ORDER BY tbl_SPNLookup.F1;
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
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
FROM tbl_SPNLookup INNER JOIN (tbl_kyc_status INNER JOIN tbl_adequacy_list ON tbl_kyc_status.status_id = tbl_adequacy_list.kyc_stat
ORDER BY tbl_SPNLookup.F1;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
ASKER