CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Listbox select with variable in where

Print topic Send  topic

Author Message
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.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.