Bill W

1. Senior Member
Join Date
Dec 1969
Posts
2,958

## Bill W

Consider the following:<BR><BR>selector = ""<BR><BR>ID = Request("ID")<BR>If ID &#060;&#062; "" Then<BR> selector = " AND impprogrammers.ID IN (" & ID & ") "<BR>End If<BR><BR><BR>SQL = "SELECT DISTINCT empprogrammers.Email " _<BR> & "FROM empprogrammers, EPC, EPLS, impprogrammers, IPC, IPLS " _<BR> & "WHERE empprogrammers.ID = EPLS.ID " _<BR> & "AND EPLS.SkillID = IPLS.SkillID " _<BR> & "AND EPLS.Proficiency &#060;= IPLS.Proficiency " _<BR> & "AND EPLS.Experience &#060;= IPLS.Experience " _<BR> & "AND empprogrammers.certreqd = True " _<BR> & "AND EPC.ID = empprogrammers.ID " _<BR> & "AND EPC.CertID = IPC.CertID " _<BR> & "AND IPC.ID = impprogrammers.ID " _<BR> & "AND IPLS.ID = impprogrammers.ID " _<BR> & selector _<BR> & " UNION " _ <BR> & "SELECT DISTINCT empprogrammers.Email " _<BR> & "FROM empprogrammers, EPC, EPLS, impprogrammers, IPLS " _<BR> & "WHERE empprogrammers.ID = EPLS.ID " _<BR> & "AND EPLS.SkillID = IPLS.SkillID " _<BR> & "AND EPLS.Proficiency &#060;= IPLS.Proficiency " _<BR> & "AND EPLS.Experience &#060;= IPLS.Experience " _<BR> & "AND empprogrammers.certreqd = False " _<BR> & "AND IPLS.ID = impprogrammers.ID " _<BR> & selector _<BR> & " ORDER BY empprogrammers.Email"<BR><BR>&#039; Uncomment next line to see what we are asking<BR>&#039; Response.Write SQL & "&#060;HR&#062;" <BR><BR>Set RS = conn.Execute( SQL )<BR>If RS.EOF Then <BR> Response.Write "" <BR>Else<BR> Do Until RS.EOF<BR> <BR>response.write rs("Email")<BR>&#039;does the employer have an e-interview<BR>If rs("intvw") = True Then<BR>Resonse.write "This employer has an e-interview on file<BR>"<BR>Response.write rs("ID")<BR>end if<BR> RS.MoveNext<BR> Loop<BR><BR>End If<BR>RS.Close<BR><BR><BR>I&#039;m getting an error that says that the field intvw can&#039;t be found. I&#039;m confused. I&#039;m pulling the Email from the same table and the field name intvw is correct. If I add empprogrammers.intvw to the select statement won&#039;t that alter the effect of the select distinct? Go easy on me it&#039;s Friday afternoon and I was up until 3 trying to get that darn programmers page to allow a user to delete an entry. &#060;tired grin&#062;

2. Senior Member
Join Date
Dec 1969
Posts
96,118

3. Senior Member
Join Date
Dec 1969
Posts
2,958