ASP request from

Posted on 2009-02-13
Last Modified: 2012-05-06
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?
Question by:lrbrister
    LVL 16

    Expert Comment

    in SQL it would be
    REPLACE(Field, ',', '')


    Author Comment


    I was hoping to strip it on the ASP side.
    LVL 39

    Expert Comment

    replace is valid asp syntax as well.  Are you looking to strip the commas, or strip everything to the right of the first comma?

    Author Comment

    Everything to the right includingthe first comma.  There shouldjust be a numbe
    LVL 39

    Accepted Solution

    SomeVar = SelectedItem....
    SomeVar = left(SomeVar, instr(SomeVar,',')-1)

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Join & Write a Comment

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
    Via a live example, show how to shrink a transaction log file down to a reasonable size.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now