A
Asib
Good afternoon all, i am in need od assistance with a switch function i was
trying to use in one of my queries.
Switch([1stTotPrice] >= 0 And [1stTotPrice] <= 20, 0, [1stTotPrice] >= 20.01
And [1stTotPrice] <= 40, 7, [1stTotPrice] >= 40.01 And [1stTotPrice] <= 100,
19.45, [1stTotPrice] >= 100.01 And [1stTotPrice] <= 200, 29, [1stTotPrice] >=
200.01 And [1stTotPrice] <= 350, 42.95, [1stTotPrice] >= 350.01 And
[1stTotPrice] <= 500, 48.25, [1stTotPrice] >= 500.01 And [1stTotPrice] <=
750, 54.85, [1stTotPrice] >= 750.01 And [1stTotPrice] < 1000, 61.4,
[1stTotPrice] > 1000.01 And [1stTotPrice] < 1250, 67.95, [1stTotPrice] >
1250.01 And [1stTotPrice] < 1600, 72.25, [1stTotPrice] >= 1600.01 And
[1stTotPrice] <= 5000, 76.2, [1stTotPrice] >= 5000.01 And [1stTotPrice] <=
6000, 76.2 + 5.9, [1stTotPrice] >= 6000.01 And [1stTotPrice] <= 7000, 76.2 +
11.8, [1stTotPrice] >= 7000.01 And [1stTotPrice] <= 8000, 76.2 + 17.7)
It became to complex to be handled. What i need help with is addapting it to
a public function. I have used them in the past but i am still learning so i
could not get the syntax right. I know it involves If then or if then else,
but i couldnt get it right.
Any and all assistance is greatly appreciated.
Thanks, Aasibs
trying to use in one of my queries.
Switch([1stTotPrice] >= 0 And [1stTotPrice] <= 20, 0, [1stTotPrice] >= 20.01
And [1stTotPrice] <= 40, 7, [1stTotPrice] >= 40.01 And [1stTotPrice] <= 100,
19.45, [1stTotPrice] >= 100.01 And [1stTotPrice] <= 200, 29, [1stTotPrice] >=
200.01 And [1stTotPrice] <= 350, 42.95, [1stTotPrice] >= 350.01 And
[1stTotPrice] <= 500, 48.25, [1stTotPrice] >= 500.01 And [1stTotPrice] <=
750, 54.85, [1stTotPrice] >= 750.01 And [1stTotPrice] < 1000, 61.4,
[1stTotPrice] > 1000.01 And [1stTotPrice] < 1250, 67.95, [1stTotPrice] >
1250.01 And [1stTotPrice] < 1600, 72.25, [1stTotPrice] >= 1600.01 And
[1stTotPrice] <= 5000, 76.2, [1stTotPrice] >= 5000.01 And [1stTotPrice] <=
6000, 76.2 + 5.9, [1stTotPrice] >= 6000.01 And [1stTotPrice] <= 7000, 76.2 +
11.8, [1stTotPrice] >= 7000.01 And [1stTotPrice] <= 8000, 76.2 + 17.7)
It became to complex to be handled. What i need help with is addapting it to
a public function. I have used them in the past but i am still learning so i
could not get the syntax right. I know it involves If then or if then else,
but i couldnt get it right.
Any and all assistance is greatly appreciated.
Thanks, Aasibs