Results 1 to 4 of 4

Thread: SQL queries

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Columbus Ohio
    Posts
    217
    How can I write a multiple conditional SQL expression? The problem is that the user types in the 2 expressions to cross reference.
    Chris

    [email protected]
    Windows XP RC2 B2526
    Visual Studio.Net Beta 2
    C++, VB, VB.Net, ASP, PHP

  2. #2
    Guest
    Code:
    Dim first
    Dim second
    
    first = text1
    second = text2
    
    sSQL = "SELECT * FROM [table] WHERE [field] = " & first & _
           " AND [field] = " & second;"
    you could use OR in place of AND

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Columbus Ohio
    Posts
    217

    I should have asked

    Is it possible to use a variable in place of the field name?
    Chris

    [email protected]
    Windows XP RC2 B2526
    Visual Studio.Net Beta 2
    C++, VB, VB.Net, ASP, PHP

  4. #4
    Guest
    dim first as string
    dim second as string

    these are both variables that
    will get the information from 2 textboxes..

    this was an assumption on my part of how
    you would get the data initially.

    then the text in the textbox is assigned to
    the variables first and second.



Posting Permissions

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



Click Here to Expand Forum to Full Width