salman.pirani Posted January 2, 2013 Share Posted January 2, 2013 Please Help Error SELECT AVG® AS Average FROM tform WHERE pt='Taming the Time Monster' Microsoft OLE DB Provider for SQL Server error '80040e07' The average aggregate operation cannot take a varchar data type as an argument. /hr/tform/admin/avrage.asp, line 20 Code<%strConnect ="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=usrtform;Initial Catalog=hrtform;Data Source=intranet;pwd=tform123"set cn= server.createobject("adodb.connection")set rs=server.createobject("adodb.recordset")cn.open strConnect sql="SELECT AVG® AS Average FROM tform WHERE pt='" & Request.Form("id") & "'"response.Write(sql)set rs=cn.execute(sql) %> <% do until rs.EOF%><tr> <%for each x in rs.Fields%> <td><%Response.Write(x.value)%></td> <%next rs.MoveNext%></tr> <%looprs.closecn.close%> Link to comment Share on other sites More sharing options...
justsomeguy Posted January 7, 2013 Share Posted January 7, 2013 The error message is pretty self-explanatory: The average aggregate operation cannot take a varchar data type as an argument. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now