• It's difficult to tell with all of those funky joins and no sample data, but you might get a win with this too;

    SELECT CAST(ID AS NUMERIC(9))

    INTO #Accounts

    FROM dbo.SplitIDs(@vcAccountId, ',')

    SELECT

    h.numDomainId,

    coa.numAccountId,

    CompanyName = ci.vcCompanyName,

    dm.numDivisionID,

    0 AS Opening,

    CONVERT(VARCHAR(20), SUM(ISNULL(d.numDebitAmt, 0))) TotalDebit,

    CONVERT(VARCHAR(20), SUM(ISNULL(d.numCreditAmt, 0))) TotalCredit,

    (SUM(ISNULL(d.numDebitAmt, 0)) - SUM(ISNULL(d.numCreditAmt, 0))) AS Closing,

    COA.numParntAcntTypeId

    FROM dbo.General_Journal_Header h

    INNER JOIN dbo.General_Journal_Details d

    ON h.numJournal_Id = d.numJournalId

    LEFT JOIN dbo.Chart_Of_Accounts coa

    ON d.numChartAcntId = coa.numAccountId

    LEFT JOIN dbo.DivisionMaster dm

    LEFT JOIN dbo.CompanyInfo ci

    ON dm.numCompanyID = ci.numCompanyId

    ON d.numCustomerId = dm.numDivisionID

    WHERE

    h.numDomainId = @numDomainID

    AND dm.numDivisionID IS NOT null -- converts dm to IJ

    AND coa.numAccountId IN (SELECT ID FROM #Accounts)

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden