I am trying to get data from a table to a datapage calculated field based on conditions that are chosen in the data page.. I get to work without any CASE & WHEN conditions i.e. if I only have to SELECT from one column, but that only takes me halfway.
Caspio continue to give me the ..... Incorrect syntax near (. and I have tried to rewrite many times.
I would appreciate it a lot if anyone can see what im doing wrong in below statement!
CASE
WHEN [@field:Agree]="NO" AND [@field:Term]="Disc1"
THEN
SELECT Price FROM Products WHERE Model=target.[@field:Model] AND Color=target.[@field:Color]
WHEN [@field:Agree]="YES" AND [@field:Term]="Disc1"
THEN
SELECT PriceReb FROM Products WHERE Model=target.[@field:Model] AND Color=target.[@field:Color]
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
Ras2019
Hi,
I am trying to get data from a table to a datapage calculated field based on conditions that are chosen in the data page.. I get to work without any CASE & WHEN conditions i.e. if I only have to SELECT from one column, but that only takes me halfway.
Caspio continue to give me the ..... Incorrect syntax near (. and I have tried to rewrite many times.
I would appreciate it a lot if anyone can see what im doing wrong in below statement!
CASE
WHEN [@field:Agree]="NO" AND [@field:Term]="Disc1"
THEN
SELECT Price FROM Products WHERE Model=target.[@field:Model] AND Color=target.[@field:Color]
WHEN [@field:Agree]="YES" AND [@field:Term]="Disc1"
THEN
SELECT PriceReb FROM Products WHERE Model=target.[@field:Model] AND Color=target.[@field:Color]
END
Sincerely
Ras
Link to comment
Share on other sites
3 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.