how to use CASE WHEN in access syntax error -


first post here go easy, new access , queries,

i have below want create case change 1 or 0 on or off in merged document,

below have tried shows syntax error? there better way? have had search cant see solution,

nz((select top 1 left(case chrconfigvalue when 'true' 'on' else 'off' end, 255) dbo_*table*_parts_config idpart= dbo_*table*_parts.idconfig , left(chrconfigname, 255) = 'dhcp_server_state'),  

access doesn't support case, use iif instead:

select top 1     left(iif(chrconfigvalue = 'true', 'on, 'off'), 255) dbo_table_parts_config     idpart = dbo_table_parts.idconfig ,     left(chrconfigname, 255) = 'dhcp_server_state' 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -