Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    48

    Unanswered: chaning nulls to zero query

    Hi,

    When I import data sometimes the values end up being imported as a blank instead of zero. I do sums later on the data and if there a blanks it is messing me up. Is there a way to run a query to change certain fields that contain nulls to zeros instead?

    thanks,

    Kevin Kristensen

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    blanks are ~not~ the same as nulls

    sums will work absolutely fine with nulls

    in your SELECT statement, use IIF(mycolumn='',NULL,mycolumn)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Sep 2011
    Posts
    48
    Quote Originally Posted by r937 View Post
    blanks are ~not~ the same as nulls

    sums will work absolutely fine with nulls

    in your SELECT statement, use IIF(mycolumn='',NULL,mycolumn)
    ok thanks

Posting Permissions

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