Results 1 to 4 of 4

Thread: SQL query syntax

  1. #1

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    what are some good resources for learning SQL query syntax? I can do simple ones, but the following problem has perplexed me.

    I want to create or filter a recordset based on a combobox selection, but the combobox selection is made up of FirstName and LastName, which are separate fields in the database. How can I say "WHERE FirstName & LastName = 'cboName.text'"? Is this possible?

  2. #2
    Guest

    Post

    Try
    WHERE FirstName = cboFname.text
    AND LastName = cboLname.text

  3. #3
    Member
    Join Date
    Nov 1999
    Posts
    63

    Post

    If you are using Visual Basic, the MSDN CD is a good place to look for SQL syntax--although it's a little light on examples. Here is a link to an online reference that may be helpful: http://torresoft.netmegs.com/

    To address your immediate need, try...

    Code:
    Dim sSQL as String
    
    sSQL = "SELECT Firstname & ' ' & Lastname AS Thename FROM YourTable WHERE Thename = '" & cboName.Text & "'"
    Gerald M.


    [This message has been edited by Gerald (edited 12-13-1999).]

  4. #4

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    Thanks! I didn't know you could combine fields like that in SQL.

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