Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi All,

 

Is it possible to have multiply WHERE statements in a SQL Statement?

 

This is the code I am currently working with:

 

               Dim str1 As String = "SwitchLoc"
               Dim str2 As String = "BladeNo"
               Dim str3 As String = "PortNo"

               Dim strNewSQLStatement As String
                       strNewSQLStatement = "SELECT " & strP2Custom & " From PermanentAssets WHERE " & _
                       str1 & " = '" & strSwitchLocValue & "' & " & _
                       str2 & " = '" & strBladeLocValue & "' & " & _
                       str3 & " = '" & strPortNoValue & "'"

 

strSwitchLocValue, strBladeLocValue, strPortNoValue are captured in another part of the program and are either set to * or a specifed value.

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

-- Rick Cook, The Wizardry Compiled

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...