Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 parameter range

Author  Topic 

drey
Starting Member

10 Posts

Posted - 2004-07-07 : 12:22:46
I there a way for a parameter be a range of strings instead of a string(example: select * from ordertable where orders in ('2', '3', '4'))?

thank you

bmanoj
Starting Member

13 Posts

Posted - 2004-07-07 : 12:31:29
Have you tried BETWEEN? Hopefully it will work

select * from ordertable where orders between '2' and '4'

Manoj
Go to Top of Page

drey
Starting Member

10 Posts

Posted - 2004-07-07 : 13:04:24
between would not work because those orders are not sequenced.
misleading example...
better example is orders in (2345, 2566, 1456) and there are many orders in between them, that i do not want in the report.
Thank you, for your reply
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-07-07 : 14:24:05
You either need to go the Dynamic SQL route, or the Pass CSV string to stored proc route.

Git yer read on!

http://www.sqlteam.com/searchresults.asp?SearchTerms=dynamic+sql

http://www.sqlteam.com/searchresults.asp?SearchTerms=csv&SUBMITs1=Search

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page
   

- Advertisement -