Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a variable with an Interdev SELECT statement

Status
Not open for further replies.

Sloth

IS-IT--Management
Jan 16, 2001
1
US
I believe the following SELECT statement is correct, but I can't get InterDev to use it:

strSQL = 'SELECT * FROM Security WHERE UserID = "' & UserID_var & '"'

I created a recordset and selected SQL Statement to gather the data. I can't get the SQL statement to work though!

Is there any way using InterDev (or the SQL Builder in InterDev) to include a variable in the SELECT statement?

Note: I tried to view the recordset as text and edit it directly, but to no avail!

Thanks in advance...Dave
 
strSQL = "SELECT * FROM Security WHERE UserID = '" & UserID_var & "'"

this should work

when including variables in an SQL statement, strings must be surrounded by single quotes, but numbers don't have to be

ex: "SELECT * FROM table WHERE name = '" & name_var & "' AND idnumber = " & number_var
ray
rheindl@bju.edu

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top