Results 1 to 2 of 2

Thread: Subselect?

  1. #1
    Join Date
    Dec 1969

    Default Subselect?

    How can I combine both SQL statements so that if no record exists in tblSubscriberRequirements.MemberId the code will still work? Right now the SQL statement only works form *EXISTING MEMBERS* who already have a record in tblSubscriberRequirements.MemberId<BR><BR>&#039 sSql = "Select * from tblSubscriberRequirements where MemberID = &#039" & session("MemberID") & "&#039"<BR><BR>sSql= "SELECT tblSubscriberRequirements.MemberId, tblUsers.UserType " _<BR>& "FROM tblSubscriberRequirements INNER JOIN tblUsers ON tblSubscriberRequirements.MemberId = tblUsers.UserName " _<BR>& "WHERE MemberID = &#039" & session("MemberID") & "&#039"<BR> rs.Open sSql,DbConn<BR><BR>&#039no tblSubscriberRequirements.MemberId record is going to be available if user has never<BR>&#039entered a record before thus this SQL statement is going to throw an error for first timers<BR>&#039entering their requirements<BR><BR>If rs("UserType") = "Level2" AND rs.RecordCount &#062;= 2 Then<BR>%&#062;

  2. #2
    sm549 Guest

    Default RE: Subselect?

    What error is thrown?<BR><BR>Try:<BR><BR>...tblSubscriberRequire ments RIGHT JOIN tblUsers...<BR><BR>&#039In case of Null UserType<BR>If Trim(rs("UserType"))...<BR><BR>HIH

Posting Permissions

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