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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where condition

Status
Not open for further replies.

uconn1981

Programmer
Mar 21, 2005
42
US
Hi, all:

How can I use numerical variable in the Where condition? For example:

JobNo = 43

SELECT * FROM JobDatabase WHERE JobID=JobNo

The above line does not work.

Thanks,

Tim
 
Usage of variables will depend on which DBMS you're using, eg for SQL Server:

Code:
DECLARE @jobno int
SET @jobno = 43

SELECT * FROM JobDatabase WHERE JobID = @jobno

--James
 
Thanks James.

I am writing ASP pages and using VBscript. How can do I this?

Tim
 
JobNo = 43
strSQL = "SELECT * FROM JobDatabase WHERE JobID=" & JobNo

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top