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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 show the details from specific field

Author  Topic 

v052207
Starting Member

3 Posts

Posted - 2007-05-23 : 21:06:02
Hi, anyone,

Please help!
In my project I’ m having one dropdownlistbox in that it displays All distinct State, In the State table, there are NY1, NY2, NJ1, NJ2, NJ3 , CA1, CA2… But I just want to show the ONLY different state, So I use:
Select distinct state from State,
then dropdownlistbox only show NY, NJ, CA, do not NY1, NY2, NJ1, NJ2, NJ3 , CA1, CA2 …
Then I want to show the details information from specific state if I m select any satae in the dropdownlistbox , then the corresponding records values should be retrive from State table and relationshop tables, But can not get them, Because each state has state1, state2, For example, selecting NY, NY including NY1, NY2…,
Please help!

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2007-05-23 : 23:59:08
Please give sample data and required output u want..
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-24 : 01:32:58
To show data in dropdown
Select distinct left(col,2) as col from table

To get data based on value selected at dropdown
Select columns from table where col like 'dropdownvalue+'%'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -