bind recordset to field
i need to know how to get sum of field named $amount?
Please help..
below is some of the sql query:
$query = "select policynum, CONVERT(varchar(10), ar.addDate, 101) AS TransDAte,
Amount
from ar, policy
where DATEDIFF(day,ar.adddate,('$_POST[start_date]')) <= 0
and DATEDIFF(day,ar.adddate,('$_POST[end_date]')) >= 0
and ar.policyid = policy.policyid
and artype = 25
order by policynum
";
//execute the SQL statement and return records
$rs = $conn->execute($query);
$policynumber = $rs->Fields(0);
$transdate = $rs->Fields(1);
$amount = $rs->Fields(2);
$sumamount = $rs->Fields(3);
|