I wonder if there is some ambiguity regarding syntax pertaining to: IS NULL vs. = ' ' (see example below). I have highlighted the differences in red bold.
Doesn't work:
CASE
WHEN '[@cbParamVirtual30]' != 0 AND [@field:tbl30_CaseObj_usrSelectedTWA] = ' ' THEN '[@cbParamVirtual30]'
WHEN [@field:tbl30_CaseObj_usrSelectedTWA] !=' ' THEN [@field:tbl30_CaseObj_usrSelectedTWA]
ELSE '[@cbParamVirtual37]'
END
Works:
CASE
WHEN '[@cbParamVirtual30]' > 0.001 AND [@field:tbl30_CaseObj_usrSelectedTWA] IS NULL THEN '[@cbParamVirtual30]'
WHEN [@field:tbl30_CaseObj_usrSelectedTWA] != ' ' THEN [@field:tbl30_CaseObj_usrSelectedTWA]
ELSE '[@cbParamVirtual37]'
END
(The > 0.001 is instead of != 0. It puzzles me why != 0 don't work.. The Case is for users to alter an app generated parameter, Virtual30, and replace it with usrSelectedTWA, or default to an app parameter virtual37 in the absence of app generated value and user input)
It would be great with a list of situations in which the respective syntax works. I tried but can't find logic, nor consistency. It becomes a time-consuming trial and error. With large form containing serial calculations, this steals a lot of valuable time from app development.
Any advice is highly appreciated, as always,
KG aka Confusius
PS: Another is ; = ' ' vs. = " " — single quotes vs. double quotes. I have been advised a few times to 'try' double quotes but don't understand when and why.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
KG360
Hello,
I wonder if there is some ambiguity regarding syntax pertaining to: IS NULL vs. = ' ' (see example below). I have highlighted the differences in red bold.
Doesn't work:
CASE
WHEN '[@cbParamVirtual30]' != 0 AND [@field:tbl30_CaseObj_usrSelectedTWA] = ' ' THEN '[@cbParamVirtual30]'
WHEN [@field:tbl30_CaseObj_usrSelectedTWA] !=' ' THEN [@field:tbl30_CaseObj_usrSelectedTWA]
ELSE '[@cbParamVirtual37]'
END
Works:
CASE
WHEN '[@cbParamVirtual30]' > 0.001 AND [@field:tbl30_CaseObj_usrSelectedTWA] IS NULL THEN '[@cbParamVirtual30]'
WHEN [@field:tbl30_CaseObj_usrSelectedTWA] != ' ' THEN [@field:tbl30_CaseObj_usrSelectedTWA]
ELSE '[@cbParamVirtual37]'
END
(The > 0.001 is instead of != 0. It puzzles me why != 0 don't work.. The Case is for users to alter an app generated parameter, Virtual30, and replace it with usrSelectedTWA, or default to an app parameter virtual37 in the absence of app generated value and user input)
It would be great with a list of situations in which the respective syntax works. I tried but can't find logic, nor consistency. It becomes a time-consuming trial and error. With large form containing serial calculations, this steals a lot of valuable time from app development.
Any advice is highly appreciated, as always,
KG aka Confusius
PS: Another is ; = ' ' vs. = " " — single quotes vs. double quotes. I have been advised a few times to 'try' double quotes but don't understand when and why.
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.