Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2012
    Posts
    1

    Unanswered: Select statement using Replace

    Code:
    SELECT stock, tops, shirts, (Replace (rap,'$','') AS price) From myTable WHERE stock IS NOT NULL;
    I'm exporting an excel spreadsheet into SqlServer 2008, the rap field contains a dollar sign which I do not want in the Sql Database, I'm trying to remove the $ sign before I import into SqlServer, I just don't know how to use the Replace option and keep getting syntax errors. I'm using C# to import.

    If possible I would like to use SELECT * there are alot of fields.

    Thanks.

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    You don't need the parentheses around Replace...price.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •