Comma Issue

  • Hi,

    I have two variables @Var1 and @Var2 which has values as follow:

    @Var1 = '23,24,78,234,890,' -- Ending with Comma

    @Var2 = ',1120,3456,6789' -- Begginning with Comma

    Can someone tell me how can I remove the Comma at the end from @Var1 and Comma in the beggining for @Var2 that variables has following value in output:

    @Var1 = '23,24,78,234,890' -- No Comma

    @Var2 = '1120,3456,6789' -- No Comma

    Thanks in advance.

    /**A strong positive mental attitude will create more miracles than any wonder drug**/

  • take a look at the thread below; another poster had the exact same problem, except he had semicolons at the beginning at or end;

    there are some fine solutions in that thread:

    http://qa.sqlservercentral.com/Forums/FindPost935459.aspx

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • gr8, thank you it worked

    /**A strong positive mental attitude will create more miracles than any wonder drug**/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply