I am attempting to write a query that uses a calculated value, I then want to cast this calculated value as a string so that I can add a '%' to the end.
However I am not succeeding with the query below:
select
a.Subjects, a.RequiredTime, b.HRS,
CAST(((b.HRS / a.RequiredTime)*100) as VARCHAR) as PercentageComplete
from
Subjects a
inner join
V_SUMMARYHOURSSUBJECT b on a.Subjects = b.Subject
This is the error that the query generates:
Error at line 1 Dynamic SQL Error SQL error code = -104 Token unknown - line 2, char 46 ) SQL