Hi,
I am a writing a website and have come accross an issue writing a function (which I am new to) using a database record, if anyone could show me the way it would be greatly appreciated.
here is the code that I have and it is creating a fault...
thanks in advance for any pointers.Code:Set rsSummaryLabour = Server.CreateObject("ADODB.Recordset") strSummaryLabour = "SELECT SUM (billingRate) as labour FROM jobsStaff WHERE job = " & request.QueryString("ID") & "" rsSummaryLabour.Open strSummaryLabour, adoCon Set rsSummaryLabourCost = Server.CreateObject("ADODB.Recordset") strSummaryLabourCost = "SELECT SUM (payRate) as labourCost FROM jobsStaff WHERE job = " & request.QueryString("ID") & "" rsSummaryLabourCost.Open strSummaryLabourCost, adoCon function labourCost labourCost = (rsSummaryLabour("billingRate") - rsSummaryLabour("payRate")) end function


(right side on this reply ) and agree


