Dreamcatchers
Posts: 120
|
Posted: 05/25/2010, 1:21 PM |
|
I am trying to average a column of data from a specific record set and display it on a form. I get no errors but no data either.
In the events table I use ID as the index.
In the Roster table I use rosterid as the index and ID is a copy of the events id for cross referencing
The column to average is SurveyQ1
So here is what I did...
Create a label name Q1 on the Events form to display the average of all Survey Question related to the Events Record which are stored in the Roster table
Created custom code for Q1 as...
Dim SQL
Dim Connection
Dim ErrorMessage
Dim surveyavg
Set Connection = New clsDBintranet
Connection.Open
SQL = "SELECT Avg(surveyq1) as surveyavg FROM Roster where id=" & events.id.Value
Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
events.Q1.Value = surveyavg
Connection.Close
Set Connection = Nothing
On Error Goto 0
Any ideas on what I am doing wrong?
_________________
Training and LMS Developer |
|
|
TheunisP
Posts: 342
|
Posted: 05/30/2010, 4:12 AM |
|
this is your 1st problem: events.Q1.Value = surveyavg
I assume you have an on error resume somewhere that is why you are not getting an error on that line, think about it for a second how is ASP supposed to kow that surveyavg is a SQL return variable?
|
|
|
|