Question
function within SELECT statement
Help please...
How can I get the my custom RFCal function to work within this select statement??
My Error:
The value SUM((a2.act_rate + a2.act_gratuity) * ap2.actpac_quantity) cannot be converted to a number.
My Code:
SELECT outer select blah blah,
(SELECT #RFCal("SUM((a2.act_rate + a2.act_gratuity) * ap2.actpac_quantity)" + p2.pac_serviceFee, p2.pac_occupancy)#
FROM tablep2 p2 INNER JOIN tableap2 ap2 ON p2.pac_id = ap2.pac_id
INNER JOIN tablea2 a2 ON ap2.act_id = a2.act_id
WHERE p2.pac_id = p.pac_id) AS myTotal
FROM tablep p INNER JOIN tableap ap ON p.pac_id = ap.pac_id
INNER JOIN tablea a ON ap2.act_id = a.act_id
WHERE outer select blah blah
How can I get the my custom RFCal function to work within this select statement??
My Error:
The value SUM((a2.act_rate + a2.act_gratuity) * ap2.actpac_quantity) cannot be converted to a number.
My Code:
SELECT outer select blah blah,
(SELECT #RFCal("SUM((a2.act_rate + a2.act_gratuity) * ap2.actpac_quantity)" + p2.pac_serviceFee, p2.pac_occupancy)#
FROM tablep2 p2 INNER JOIN tableap2 ap2 ON p2.pac_id = ap2.pac_id
INNER JOIN tablea2 a2 ON ap2.act_id = a2.act_id
WHERE p2.pac_id = p.pac_id) AS myTotal
FROM tablep p INNER JOIN tableap ap ON p.pac_id = ap.pac_id
INNER JOIN tablea a ON ap2.act_id = a.act_id
WHERE outer select blah blah
