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.
| Author |
Topic |
|
sinjin67
Yak Posting Veteran
53 Posts |
Posted - 2010-10-23 : 01:32:09
|
| I am having trouble with this function. I would to setupa select statement that returns the correct value to mygridview. I am using a drop down list to select the intialvalue. In this case I have a string field of 50 chars andwithin it I need to find the "Number" for example 10 and with it is some text "KVA" so the the field may have somethinglike this "123 - Something - 30KVA - Something"When I setup a select statment using the % to grab the number frommy drop down list I can end up with anything having 3 or 0. examplewould be the number 10 it will always return 10KVA and 100KVA.Can anyone show me a method to where I can format to only returnmy selected value ? or I am going the wrong way with and should be looking at a different method.Basic Command I have been playing with.SelectCommand="SELECT [idTest], [testme] FROM [Table1] WHERE ([testme] < '%' + @testme + '%' & '%')">Also tried to look at using Less/Greater then function but go no working method without having recortds returnedthat I dont want.Any help would be great. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-10-23 : 01:38:33
|
| one question herein 123 - Something - 30KVA - Somethingyou've two numbers 123 and 10. so do you want both or the one attached to KVA only always?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
sinjin67
Yak Posting Veteran
53 Posts |
Posted - 2010-10-23 : 15:31:29
|
| Just the one attached to the KVA,I thought I could use something like %K or %KVA but it will give me the 10KVA and the 100KVA when I onlywant to show the 10KVAThanks for looking at this help request |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-10-27 : 13:48:20
|
| is the alphabetic part constant? that is always KVA?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
sinjin67
Yak Posting Veteran
53 Posts |
Posted - 2010-10-29 : 14:13:42
|
| Yes, The alpha part is always KVA in caps. |
 |
|
|
|
|
|