query problem

Results 1 to 2 of 2

Thread: query problem

  1. #1
    Join Date
    Dec 1969

    Default query problem

    I have two tables<BR><BR>Message_ASTO(Message_id,AS_TO)<BR>re cords in this table are like this<BR>Message_id AS_TO<BR>-----------------------------<BR>1 a@a.com<BR>1 b@b.com<BR>1 c@c.com<BR><BR><BR>Message_master<BR>-----------------------------------<BR>Message_id Message initiator<BR>1 asdfasfasdf c@c.com<BR>2 asdfasfdasdfdsa b@b.com <BR>3 rjrjrjrjrj a@a.com <BR><BR><BR>Login_master<BR>----------------------------------------<BR>Login_id Login_email status<BR>------------------------------------<BR>1 a@a.com 0<BR>2 b@b.com 1<BR>3 c@c.om 2 <BR><BR>when a user logs in to my site I am capturing his emailid in session..session("USER_EMAIL")<BR><BR>I have a variable in which will have some emailids<BR>ASTO="&#039;v@v.com,a@a.com&#039;,c@c. com"<BR><BR><BR>I have to write a query which will fetch the status from login_master<BR>if session("USER_EMAIL") is (one among the ids in Message_ASTO.as_to or message_master.initiator)<BR><BR><BR>Pls help

  2. #2
    Join Date
    Dec 1969

    Default RE: query problem

    Are you sure about this?<BR>ASTO="&#039;v@v.com,a@a.com&#039;,c@c.com "<BR>** look at it closely<BR><BR>Shouldn&#039;t it be<BR>ASTO="&#039;v@v.com&#039;,&#039;a@a.com&#039 ;,&#039;c@c.com&#039;"<BR><BR>Then all you would have to do is;<BR>SQL = "SELECT * FROM Login_Master " & _<BR>"WHERE Login_Email IN("& ASTO &")"<BR>Set rs = oConn.Execute(SQL) &#039;oConn = connection<BR><BR>If rs.eof Then<BR>...<BR>Else<BR>...<BR>End If<BR><BR>good luck,<BR>jc

Posting Permissions

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