-
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?
-
Try
WHERE FirstName = cboFname.text
AND LastName = cboLname.text
-
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).]
-
Thanks! I didn't know you could combine fields like that in SQL.