0
votes

I have a column called 'number of Days' with whole number data type. Goal is to have another column return a string based on the 'number of days' column, e.g. 5 --> "0-7 days", 10 --> "8-30 days" etc.

I tried to use the SWITCH function but it returns a syntax error when I put a logical test in it:

SWITCH([number of days], <8, "0-7 days", <31, "8-30 days", <continued>

I want to avoid the IF statement because I have 8 strings (I shortened the example for brevity) and I don't want to nest that stament many times.

1

1 Answers

0
votes

Use in this manner:

SWITCH(TRUE(), [number of days] <8, "0-7 days", [number of days] <31, "8-30 days", <continued>