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
 Changing Case to upper case

Author  Topic 

JJ297
Aged Yak Warrior

940 Posts

Posted - 2010-03-17 : 10:25:35
How do I change whatever is typed in the PIC field it will come out as uppercase...example c1 should display as C1

[code
SELECT Claim, PIC, DocPmt, LAF, PCInd, FinalLaf, convert(varchar,dteIn,101) as dteIn, Remarks,
BicAdj,NoBIC, IA, FD, Convert(varchar,dtetofo,101) as dteToFO, convert(varchar,DteBack,101) as DteBack,
Results, Convert(varchar,Convert(money,Amt),1) as Amt
FROM TestData
WHERE claim = @claim and pic = @pic][/code]

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-17 : 10:28:19
its a presentation issue and its best to do this at front end. if you dont have a front end app as such, then use UPPER() function in T-sql

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

Go to Top of Page

JJ297
Aged Yak Warrior

940 Posts

Posted - 2010-03-17 : 10:34:34
How would I change it on the front end?

Here's my text box:

<asp:TextBox ID="PICTxt" runat="server" MaxLength="2" Width="95px"></asp:TextBox>


I found this on the internet. Where could I place this on the front end?

Private Sub btn_ToUpper_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim str As String = String.Empty
str = txt_value2.Text
Dim b As Char
If str <> String.Empty Then
b = [Char].ToUpper(str(0))
txt_Result2.Text = b.ToString()
End If
End Sub
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-03-17 : 13:34:07
No need for a button also will be more user friendly if it can be done in the client script.My suggestion would be that on the onkeyup event of textbox u can write some javascript function that will convert every character to uppercase.Something like this

<asp:TextBox ID="PICTxt" runat="server" MaxLength="2" Width="95px" onkeyup=this.value.toUpperCase()></asp:TextBox>

PBUH
Go to Top of Page

JJ297
Aged Yak Warrior

940 Posts

Posted - 2010-03-17 : 20:24:52
Thanks so much! I used code behind but this is good to know how to do it within the textbox.
Go to Top of Page
   

- Advertisement -