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
 Data from Form to SQL in UPPER case

Author  Topic 

Vergy39
Starting Member

15 Posts

Posted - 2012-11-30 : 10:48:26
I have a form where customer data is entered. To speed up productivity, I want the users to be able to just type names and addresses and such and not worry about upper and lower case. I want it to convert to all UPPER when the user clickes submit on the form. I have an insert query and I have tried to add the UPPER function to it as well as the UCase, but it will not work. Here is what the query looks like and it works, but does not convert to UPPER case.

myConn.execute "INSERT INTO TFSRequests (LogonUser, cFirstName, cLastName, MaskedNum, PhnNum, Addr, City, State, Zip, Amt, ReasonFK, rcdCreateDate) Values ('" & request.form("strEntUser") & "', '" & request.form("strcFirstName") & "', '" & request.form("strcLastName") & "', '" & request.form("strMaskedNum") & "', '" & request.form("strPhnNum") & "', '" & request.form("strAddr") & "', '" & request.form("strCity") & "', '" & request.form("strState") & "', '" & request.form("strZip") & "', " & request.form("strAmt") & ", '" & request.form("strReasonID") & "', '" & Now() & "')"

Any assistance is greatly appreciated.
Thanks
David V

Elizabeth B. Darcy
Starting Member

39 Posts

Posted - 2012-11-30 : 17:56:12
If you would like to convert it to upper case in SQL, change each value in your values clause like shown below:
Values (UPPER('"& request.form("strEntUser") & "'), 
UPPER('" & request.form("strcFirstName") & "'),p


________________________________________
-- Yes, I am indeed a fictional character.
Go to Top of Page

Vergy39
Starting Member

15 Posts

Posted - 2012-12-04 : 17:49:38
Thanks Elizabeth, that did work.
Go to Top of Page
   

- Advertisement -