|
-
Dec 12th, 1999, 02:22 AM
#1
Thread Starter
Hyperactive Member
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?
-
Dec 12th, 1999, 03:22 AM
#2
Try
WHERE FirstName = cboFname.text
AND LastName = cboLname.text
-
Dec 12th, 1999, 06:36 AM
#3
Member
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).]
-
Dec 12th, 1999, 10:31 AM
#4
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|