Group by Problem
Hello,
I am trying to display the names in the drop down
Code:
strgetrecords="SELECT Registration.Id, Registration_Fname, Registration_Lname from Registration, Arts_Registration where Registration.Id=Arts_Registration.FId and Registration.Status='Used' and Registration.RespMsg='Authorized' and DATEPART('yyyy',Registration.DateTimeAdded) = '" & getperiodhistory3 & "' AND DATEPART('m',Registration.DateTimeAdded) = '" & getperiodhistory2 & "' GROUP BY Registration.Id, Registration_Fname, Registration_Lname ORDER BY Registration.Id desc"
Set rsinfo= Conn.Execute(strgetrecords)
%>
<select name="dirname" id="dirname" size="1" onChange="this.form.action = '<%=Request.ServerVariables("Script_Name")%>'; this.form.submit();">
<option value="">Select a Name</option>
<%
If Not rsinfo.eof then
Do While Not rsinfo.eof
%>
<option <%if Trim(rsinfo("Id"))=Trim(Request.Form("dirname")) then Response.Write "selected" end if%>
value=<%=rsinfo("Id")%>><%=rsinfo("Registration.Fname")%> <%=rsinfo("Registration.Lname")%></option>
<%
rsinfo.movenext
Loop
End If
rsinfo.close
Set rsinfo=Nothing
%>
</select>
and it gives an error saying cannot use FName in aggregrate function
Can someone tell me what i am doing wrong
todd2006, March 11th, 2009 09:39 PM
Bookmarks