• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 605
  • Last Modified:

How can I convert a null column to a space when testing a integer column

Hello,

I have the following

SELECT       MakeID_NAPA,
              ISNULL(EngineID_NAPA, '') AS EngineID_NAPA,                  
FROM         NAPA_Catalog

where I check the EngineID_NAPA column for a null value.

Rather than replacing it with an integer I want to replace it with a space.  The above statement shows 0 rather than space.

I tried casting but the check is done before the cast with a resulting '0'

Any help is appreciated.

Thank you
0
Mevotech
Asked:
Mevotech
1 Solution
 
MevotechAuthor Commented:
Answered my own question by writing it out, just reversed the logic

ISNULL(CAST(EngineID_NAPA AS VARCHAR(3)),'') AS EngineID_NAPABlank,

and works.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

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