I am using switch statement in access 2007, i want to know how I can specify default value
select
switch
(
MyCol = 1, 'Value is One',
MyCol = 2, 'Value is Two'
) from MyTable
Thanks
SELECT
Switch(MyTable.[MyCol]='1','Terrestrial',
MyTable.[MyCol]='2','Value is two',MyTable.[MyCol]='3','Value is three',
True,'Error') AS ColumnName
FROM MyTable;
select
switch
(
MyCol = 1, 'Value is One',
MyCol = 2, 'Value is Two'
True,"Default"
) from MyT
Refer:
http://www.utteraccess.com/forum/Switch-statement-default-t453140.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With