Default value for switch in access 2007

I use the switch statement in access 2007, I want to know how I can specify the default value

select switch ( MyCol = 1, 'Value is One', MyCol = 2, 'Value is Two' ) from MyTable 

thanks

+7
source share
2 answers
 SELECT Switch(MyTable.[MyCol]='1','Terrestrial', MyTable.[MyCol]='2','Value is two',MyTable.[MyCol]='3','Value is three', True,'Error') AS ColumnName FROM MyTable; 
+11
source
 select switch ( MyCol = 1, 'Value is One', MyCol = 2, 'Value is Two' True,"Default" ) from MyT 

Cm:

http://www.utteraccess.com/forum/Switch-statement-default-t453140.html

+11
source

All Articles