Mar 30, 2005 #1 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
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
Mar 30, 2005 #2 JamesLean Programmer Dec 13, 2002 3,059 GB 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 Upvote 0 Downvote
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
Mar 30, 2005 Thread starter #3 uconn1981 Programmer Mar 21, 2005 42 US Thanks James. I am writing ASP pages and using VBscript. How can do I this? Tim Upvote 0 Downvote
Mar 30, 2005 #4 PHV MIS Nov 8, 2002 53,708 FR 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 Upvote 0 Downvote
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