Walti
|
| Posted: 04/16/2002, 2:43 AM |
|
Hi
I'am looking for a solution to expand the "SQL where" clause with a variable.
This should working in list box.
I was already trying the various examples (from other thread's) but did not succeed.
I'm using MS-SQL 2000,
here the Lookup SQl code for the listbox.
-- -- -
SELECT distinct
[LoadId],
[Name]
FROM [notos].[dbo].[c_load_spec]
WHERE [Lounge]=0 and customerid= <<<<here value of variable customerid should go)
--
Thank's
|
|
|
 |
Alex Alexapolsky
|
| Posted: 04/16/2002, 4:48 AM |
|
All the solutions are the same , your is like this
SELECT distinct
[LoadId],
[Name]
FROM [notos].[dbo].[c_load_spec]
WHERE [Lounge]=0 and customerid= " & variable & "
|
|
|
 |
Walti
|
| Posted: 04/16/2002, 6:10 AM |
|
With this statement it works.
Thanks for the help.
---
SELECT distinct
[LoadId], [Name]
FROM [notos].[dbo].[c_load_spec]
WHERE [Lounge]=0 and [CustomerId] = '" & getParam("CustomerID") & "'
order by [name]
----
|
|
|
 |
Walti
|
| Posted: 04/16/2002, 6:10 AM |
|
Thanks but did not work.
This is the error msg :
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Line 1: Incorrect syntax near '='.
any suggestions ?
|
|
|
 |
Nicole
|
| Posted: 04/16/2002, 6:26 AM |
|
Walti,
note that you should assign any value to "variable" in form Open event.
|
|
|
 |
|