Hi Friends from stackoverflow
I ran into an issue with access and sql, find below my query
update finaldata set [Area]=
IIF(InStr(1,[Name],'PoolSide',1)<>0,'PoolSide',
IIF(InStr(1,[Name],'Mountainside',1)<>0,'Mountainside',
IIF(InStr(1,[Name],'Garden Area',1)<>0,'Garden Area',
IIF(InStr(1,[Name],'Ground Floor',1)<>0,'Ground Floor',
IIF(InStr(1,[Name],'Annex Building',1)<>0,'Annex Building',
IIF(InStr(1,[Name],'Beachside',1)<>0,'Beachside',
IIF(InStr(1,[Name],'Beachfront',1)<>0,'Beachfront',
IIF(InStr(1,[Name],'Mountainside',1)<>0,'Mountainside',
IIF(InStr(1,[Name],'Executive',1)<>0,'Executive Level',
IIF(InStr(1,[Name],'Lakeside',1)<>0,'Lakeside',
IIF(InStr(1,[Name],'Mezzanine',1)<>0,'Mezzanine',
IIF(InStr(1,[Name],'Oceanfront',1)<>0,'Oceanfront',
IIF(InStr(1,[Name],'Overwater',1)<>0,'Overwater,
IIF(InStr(1,[Name],'Slope side',1)<>0,'Slope side',
IIF(InStr(1,[Name],'Tower',1)<>0,'Tower,'Delete'
)))))))))))))))
I have 100k records, I dont want to use recordset it takes too long i already tried it. I have to many inner joins and my database file it's getting larger.
what are my options to process the strings? I have a long long string stored in [Name] with many characteristics of a room. I am trying to decipher the name.
if my only option is a record set, what would be faster to process a nested if or select case?
Thank you for your time and help
IIF(InStr(1,[Name],'Overwater',1)<>0,'Overwater,
is missing a single quote causing the expression to get parsed incorrectly. Secondly, don't nest manyIIF
s, useSWITCH
instead – Erik ATower
is also missing second apostrophe. – June7