[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

ASP request from

I'm grabbing the selected data fom a form and sending it to a stored procedure in SQL Server
Request.Form("dptAirSr").ToString()  goes as nvarchar(10)

When they select the number from the dropdown ot plaves this
SelectedItem = 3  stores 3,0,0

How do I strip the commas?
0
lrbrister
Asked:
lrbrister
  • 2
  • 2
1 Solution
 
brad2575Commented:
in SQL it would be
REPLACE(Field, ',', '')

0
 
lrbristerAuthor Commented:
brad2575:

I was hoping to strip it on the ASP side.
0
 
BrandonGalderisiCommented:
replace is valid asp syntax as well.  Are you looking to strip the commas, or strip everything to the right of the first comma?
0
 
lrbristerAuthor Commented:
BrandonGalderisi:
Everything to the right includingthe first comma.  There shouldjust be a numbe
0
 
BrandonGalderisiCommented:
SomeVar = SelectedItem....
SomeVar = left(SomeVar, instr(SomeVar,',')-1)
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now