Results 1 to 2 of 2

Thread: Formatting an SQL select

  1. #1
    Join Date
    Sep 2012
    Posts
    1

    Formatting an SQL select

    Hi, I am trying to format the SQL query i have below in order to have the CoLocalCount show up with '# of Locals:' in front of the actual Count itself. I have changed to count to varchar in order for it to be able to read text but no matter where i put the actual 'quotes' it errors out. Any help would be appreciated.


    SELECT *
    FROM
    (
    SELECT 'Company Name : ' + JE.NAME AS CompanyName,
    --CoJC.Code AS CoLocalCode,
    CAST(COUNT (CoJC.Code) AS varchar(25)) AS CoLocalCount,

    --
    JWL.NAME AS WorklocationName,
    --WLJC.Code AS WLLocalCode
    CAST(COUNT(WLJC.Code) AS varchar(25)) AS WLLocalCount
    FROM dbo.Job_Employer JE

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Where is '# of Locals:' supposed to be in the query?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •