I'm trying to save a bit of coding, and have the following SQL statement:
the argument values are
personid = 4
startdate = '2010-03-02'
enddate = '2010-03-18'
If I use the column identifiers above (as startdate, as enddate, as totalhrs) this statement returns an empty resultset.
If I change the SQL to the following (by removing the as startdate, as enddate, as totalhrs) I do get a result set, but am unable to figure out what the column names are:
When building this in Alpha, and using preview query, i see the column names appear as min_timdate_, max_timdate_, sum_timhours_, but the error: "Column not found while getting result set data column" is returned, when i try to run the following code:
Does anyone have a suggestion as to what the field names might be?
I tried using column numbers, ie: rs.data(0) but this syntax is not supported.
Thanks,
Robert
PHP Code:
SELECT min(timdate) as startdate, max(timdate) as enddate, sum(timhours) as totalhrs from timesheet
inner join rate on rate.perid = timesheet.perid
where (timesheet.perID=:personid) and (timDate between :startDate AND :endDate) and (timesheet.timDate between ratstartdate and ratenddate)
GROUP BY ratid
personid = 4
startdate = '2010-03-02'
enddate = '2010-03-18'
If I use the column identifiers above (as startdate, as enddate, as totalhrs) this statement returns an empty resultset.
If I change the SQL to the following (by removing the as startdate, as enddate, as totalhrs) I do get a result set, but am unable to figure out what the column names are:
PHP Code:
SELECT min(timdate), max(timdate), sum(timhours) from timesheet
inner join rate on rate.perid = timesheet.perid
where (timesheet.perID=:personid) and (timDate between :startDate AND :endDate) and (timesheet.timDate between ratstartdate and ratenddate)
GROUP BY ratid
PHP Code:
sMsg = sMsg + " startdate: " + rs.Data("min_timdate_")
I tried using column numbers, ie: rs.data(0) but this syntax is not supported.
Thanks,
Robert
Comment