I was wondering if it is possible to insert the result of a calculated field back into the data table I'm using as a data source with the SQL INSERT INTO function? I'm using SQL to create a SUM within the calculated field already. This is what I have and it works:
SELECT
SUM (CASE
WHEN [@field:ReturnMaster_File_Type] = 'Federal' AND
[@field:ReturnMaster_ACCEPTED] <= '2/15/2015' AND
[@field:ReturnMaster_Sent] = '' THEN
[@field:InfusionsoftCustomers_a2014_Fed_EF_Fee]
WHEN [@field:ReturnMaster_File_Type] = 'State' AND
[@field:ReturnMaster_ACCEPTED] <= '2/15/2015' AND
[@field:ReturnMaster_Sent] = ''THEN
[@field:InfusionsoftCustomers_a2014_State_EF_Fee]
ELSE 0
END) FROM _v_BillingView where ReturnMaster_EFIN = target.[@field:ReturnMaster_EFIN]
I'm not super familiar with SQL but I was thinking it might be possible. I was trying something like this:
INSERT INTO BillingView (InfusionsoftCustomers_AmountBilled2)
VALUES
(SELECT
SUM (CASE
WHEN [@field:ReturnMaster_File_Type] = 'Federal' AND
[@field:ReturnMaster_ACCEPTED] <= '2/15/2015' AND
[@field:ReturnMaster_Sent] = '' THEN
[@field:InfusionsoftCustomers_a2014_Fed_EF_Fee]
WHEN [@field:ReturnMaster_File_Type] = 'State' AND
[@field:ReturnMaster_ACCEPTED] <= '2/15/2015' AND
[@field:ReturnMaster_Sent] = ''THEN
[@field:InfusionsoftCustomers_a2014_State_EF_Fee]
ELSE 0
END) FROM _v_BillingView where ReturnMaster_EFIN = target.[@field:ReturnMaster_EFIN])
Of course this comes back as Invalid. Since I'm not familiar with SQL I wasn't sure if my syntax was wrong or if it just ins't possible within Caspio. Any insight would be greatly appreciated.
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
WillJennings
I was wondering if it is possible to insert the result of a calculated field back into the data table I'm using as a data source with the SQL INSERT INTO function? I'm using SQL to create a SUM within the calculated field already. This is what I have and it works:
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.