Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Extraction problem


Message #1 by "scott frank" <scott@w...> on Wed, 10 Oct 2001 06:13:55
The first section extracts a list of group_id numbers for the departments

a particular (p_name) manager is assigned to. This section works perfectly.



The last section is where I am having the problem.  I am trying to compare 

the group_id in the user_manager table with group_id in company_code table 

and display only those departments that the manager is not assigned to.  

The code in the Unassigned section only filters out some of the assigned 

departments.  Am I missing something really simple here? Thanks in advance 

for any help you can provide.  Scott



<%'---Assigned to----



set objCC = DataConn.Execute ("SELECT * FROM user_manager " & _ 

"WHERE username = '" & p_name & "'" & _

" ORDER BY user_manager.group_id")  

If not objCC.EOF Then 

Response.write "Manager is assigned to " %> 

      <select name="select">

        <%While not objCC.EOF  %>

<% p_inGroup = objCC("group_id") %> 

        <option value="<%=p_inGroup%>"><%=p_inGroup%> <%objCC.MoveNext

Wend

	Else

p_inGroup = ""

Response.write "Manager is not assigned to any workgroups."

	End If 

objCC.close

set objCC = Nothing %>



<%'--------Unassigned list--------

If not p_inGroup = "" Then

set objCC = DataConn.Execute ("SELECT * FROM company_code " & _

"WHERE group_id <> " & p_inGroup & _

" ORDER BY company_code.department") 

If not objCC.EOF Then 

Response.write "Manager can be assigned to " %> 

      <select name="p_outGroup">

        <%Do While Not objCC.EOF  %> 

      <option value="<%=objCC("group_id")%>"><%=objCC("department")%> <%

objCC.MoveNext

Loop

	Else

	End If

End If

objCC.close

set objCC = Nothing

  Return to Index