+ Reply to Thread
Results 1 to 2 of 2

Thread: Group by Problem

  1. #1
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    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")%>&nbsp;<%=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

  2. #2
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    Ok i fixed the problem by changing the code like this

    <%=rsinfo("Fname")%>&nbsp;<%=rsinfo("Lname")%></option>

+ Reply to Thread

Similar Threads

  1. Report date range as years in option group
    By tuxalot in forum Microsoft Access
    Replies: 8
    Last Post: March 9th, 2009, 11:47 PM
  2. order by group by problem
    By todd2006 in forum SQL Development
    Replies: 9
    Last Post: March 9th, 2009, 03:16 PM
  3. Sql group by
    By BLaaaaaaaaaarche in forum SQL Development
    Replies: 4
    Last Post: February 12th, 2009, 12:27 PM
  4. Summing for each group only
    By Rebelle in forum ASP Development
    Replies: 13
    Last Post: June 5th, 2008, 02:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO