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

add text to sql select statement

I need help adding text to a select statement

select  '<b>Subtotal:</b>' + (@Query1 - @Query2)

@Query1 and @Query2 are int values in a stored procedure

@Query1 looks something like
      Select @Query1 = Sum(Total)

     from (select distinct Total, type,unitid

             from tbltesting

            where convert(char(8), Date, 112) = @Date -1)as TMP


The error I get is 'Syntax error converting the varchar value to a column int'
0
ETKN
Asked:
ETKN
1 Solution
 
morisceCommented:
select  '<b>Subtotal:</b>' + convert(varchar, (@Query1 - @Query2) )
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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