Case When Statement resulting in number values

5 pts.
Tags:
SQL
How to write my CASE WHEN statement to result in number values? I am using for example WHEN "PUMPS' THEN '.50'' ELSE 'N/A' END. However the .5 value is in text form and I need that to be in number form.

Answer Wiki

Thanks. We'll let you know when a new response is added.

It looks like you cannot have both a numeric value and an alphanumeric be represented in the same column. Instead of the “N/A” try returning a zero.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    Rather than a zero, the column should be null-capable and the value set to null. SQL itself shouldn't be setting both number and alphanumeric values into the same column of a result set. Rather some report writer or other program should be printing or displaying the final values using "N/A" as the representation for null.
    25,125 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: