Solved

Help with Select Statement

Posted on 2009-07-07
2
166 Views
Last Modified: 2012-05-07
I'm trying to format the output of and keep getting an error: Conversion failed when converting the varchar value '(ok)' to data type int.

Here is my code:
SELECT          SUM(VOID_COUNT) + '(ok)'  AS 'Voids'
FROM            SALES_SUMMARY
WHERE        (STOREID = 14) AND (check_file_date = '7/6/2009')

I'm trying to produce this output:
Voids
12 (ok)

Any ideas here?
0
Comment
Question by:mattkovo
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
Comment Utility
SELECT         cast(  SUM(VOID_COUNT) as varchar) + '(ok)'  AS 'Voids'
FROM            SALES_SUMMARY
WHERE        (STOREID = 14) AND (check_file_date = '7/6/2009')

0
 

Author Closing Comment

by:mattkovo
Comment Utility
I just came up with the same solution.  Thanks!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now