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

Help with Select Statement

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'
WHERE        (STOREID = 14) AND (check_file_date = '7/6/2009')

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

Any ideas here?
1 Solution
Aneesh RetnakaranDatabase AdministratorCommented:
SELECT         cast(  SUM(VOID_COUNT) as varchar) + '(ok)'  AS 'Voids'
WHERE        (STOREID = 14) AND (check_file_date = '7/6/2009')

mattkovoAuthor Commented:
I just came up with the same solution.  Thanks!
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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