I have a calculated field that is calculating the ID of the value I am trying to get. This calculation is working properly:
SELECT Pay_Plan_ID
FROM JFM_Grade_Order_List
WHERE Org_ID = target.[@field:JFM_Job_Description_Org_ID]
AND (
(target.[@field:JFM_Job_Description_Department] <> 'Various' AND Class_ID = target.[@field:JFM_Job_Description_Class_ID])
OR
((target.[@field:JFM_Job_Description_Department] = 'Various' OR target.[@field:JFM_Job_Description_Department] = 'Multiple' OR target.[@field:JFM_Job_Description_Department] = '') AND Recommended_Class = target.[@field:JFM_Job_Description_Class_Title])
)
When using a second calculated field to pull the corresponding Pay_Plan name listed below, it works as expected:
SELECT Pay_Plan FROM JFM_Plan_Type WHERE Pay_Plan_ID = [@calcfield:1]
However, in an effort to streamline things a bit, I want to combine these into one calculated field. When I do so, I am getting an error. Is there a restriction of some kind within Caspio that prevents this from working, or is there some basic SQL mistake I am making? The combined code is shown below, this is what is causing an error:
SELECT Pay_Plan FROM JFM_Plan_Type WHERE Pay_Plan_ID =
(
SELECT Pay_Plan_ID
FROM JFM_Grade_Order_List
WHERE Org_ID = target.[@field:JFM_Job_Description_Org_ID]
AND (
(target.[@field:JFM_Job_Description_Department] <> 'Various' AND Class_ID = target.[@field:JFM_Job_Description_Class_ID])
OR
((target.[@field:JFM_Job_Description_Department] = 'Various' OR target.[@field:JFM_Job_Description_Department] = 'Multiple' OR target.[@field:JFM_Job_Description_Department] = '') AND Recommended_Class = target.[@field:JFM_Job_Description_Class_Title])
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
Connonymous
I have a calculated field that is calculating the ID of the value I am trying to get. This calculation is working properly:
SELECT Pay_Plan_ID
FROM JFM_Grade_Order_List
WHERE Org_ID = target.[@field:JFM_Job_Description_Org_ID]
AND (
(target.[@field:JFM_Job_Description_Department] <> 'Various' AND Class_ID = target.[@field:JFM_Job_Description_Class_ID])
OR
((target.[@field:JFM_Job_Description_Department] = 'Various' OR target.[@field:JFM_Job_Description_Department] = 'Multiple' OR target.[@field:JFM_Job_Description_Department] = '') AND Recommended_Class = target.[@field:JFM_Job_Description_Class_Title])
)
When using a second calculated field to pull the corresponding Pay_Plan name listed below, it works as expected:
SELECT Pay_Plan FROM JFM_Plan_Type WHERE Pay_Plan_ID = [@calcfield:1]
However, in an effort to streamline things a bit, I want to combine these into one calculated field. When I do so, I am getting an error. Is there a restriction of some kind within Caspio that prevents this from working, or is there some basic SQL mistake I am making? The combined code is shown below, this is what is causing an error:
SELECT Pay_Plan FROM JFM_Plan_Type WHERE Pay_Plan_ID =
(
SELECT Pay_Plan_ID
FROM JFM_Grade_Order_List
WHERE Org_ID = target.[@field:JFM_Job_Description_Org_ID]
AND (
(target.[@field:JFM_Job_Description_Department] <> 'Various' AND Class_ID = target.[@field:JFM_Job_Description_Class_ID])
OR
((target.[@field:JFM_Job_Description_Department] = 'Various' OR target.[@field:JFM_Job_Description_Department] = 'Multiple' OR target.[@field:JFM_Job_Description_Department] = '') AND Recommended_Class = target.[@field:JFM_Job_Description_Class_Title])
))
Link to comment
Share on other sites
6 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.