Switch syntax error
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I try to switch the month number to the month name as below, but the result is empty....... what's going on??
Please note that the month numbers bare int 16 Thank you.
Switch([MONTH], Null(),
"01","FEB",
"02","MAR",
"03","APR",
"04","MAY",
"05","JUN")
Solved! Go to Solution.
- Labels:
- Common Use Cases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Try switching the month column to a String.
You can use a Select tool right before the Switch formula.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Are you trying to create a new column or update the exiting Month column?
If you are updating the column, you should convert the month numbers to a string first using the Select tool. If you are creating new column, your switch statement should work if you use the following:
SWITCH([Month], NULL(),
1, "Feb",
2, "Mar"
.....
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Dan, yes you are right!! I was running this query under "in database"
Unfortunately, the "in database" select function doesn't allow you to review and change the data type...
I totally missed...
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Nick;
I was trying to update under the same column..
But since I was in "in database", the select function doesn't allow you to review and change the data type, so I totally missed it..
Thank you for your helps!
