0
(WATCHDOGACIDT.COMASCALEE + WATCHDOGACIDT.COMASCALEV + 
                      WATCHDOGACIDT.COMASCALEM) AS EVM           --not work

(PATIENT_NAME.FIRSTNAME +' '+ PATIENT_NAME.LASTNAME) AS Fullname --work great 

but this code return summary

ex 1 + 2 + 3 i would like return 123 but return 6 thank

2 Answers 2

4

Like this:

CAST(myIntegerVar AS varchar(50)) + ' some text etc'

so:

(CAST(WATCHDOGACIDT.COMASCALEE as varchar(1)) + CAST(WATCHDOGACIDT.COMASCALEV AS varchar(1)) + CAST(WATCHDOGACIDT.COMASCALEM AS varchar(1)) ) AS EVM
Sign up to request clarification or add additional context in comments.

Comments

1

Mitch's answer has the right approach, but in case you don't always know the length of the value you are casting to a varchar you don't need to specify the length. i.e. if one of your numbers was 450 or something, the varchar(1) wouldn't do the trick.

Like this:

CAST(myIntegerVar AS varchar) + ' some text etc'

(CAST(WATCHDOGACIDT.COMASCALEE as varchar) + CAST(WATCHDOGACIDT.COMASCALEV AS varchar) + CAST(WATCHDOGACIDT.COMASCALEM AS varchar) ) AS EVM

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.