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
 General SQL Server Forums
 New to SQL Server Programming
 prevent incorrect value from populating gridview

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 setup
a select statement that returns the correct value to my
gridview. I am using a drop down list to select the intial
value. In this case I have a string field of 50 chars and
within it I need to find the "Number" for example 10 and
with it is some text "KVA" so the the field may have something
like this "123 - Something - 30KVA - Something"

When I setup a select statment using the % to grab the number from
my drop down list I can end up with anything having 3 or 0. example
would be the number 10 it will always return 10KVA and 100KVA.

Can anyone show me a method to where I can format to only return
my 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 returned
that 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 here

in 123 - Something - 30KVA - Something

you've two numbers 123 and 10. so do you want both or the one attached to KVA only always?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

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 only
want to show the 10KVA

Thanks for looking at this help request
Go to Top of Page

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 MVP
http://visakhm.blogspot.com/

Go to Top of Page

sinjin67
Yak Posting Veteran

53 Posts

Posted - 2010-10-29 : 14:13:42
Yes, The alpha part is always KVA in caps.
Go to Top of Page
   

- Advertisement -