Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)

  • RE: problem with 'Ad Hoc Distributed Queries'

    Someone please?!

  • RE: Newbie question for small query

    Christopher Stobbs (4/28/2009)


    SELECT p.Name, sCost, mCost, hCost, tCost

    FROM TProject p

    OUTER APPLY (SELECT SUM(Cost) as sCost,idProject FROM TSoftware WHERE idProject = p.idProyect GROUP BY idProject) s

    OUTER APPLY (SELECT SUM(Cost) as...

  • RE: Newbie question for small query

    Yes sorry, my bad! I already edited my last post:-D. Thanks a lot for the help!

  • RE: Newbie question for small query

    HI! It is finally working! I didnt know that it will be so complicated, when I thought of it I remeber thinking what a piece of cake lol...thanks everyone for...

  • RE: Newbie question for small query

    HI!,

    SELECT p.name, SUM(s.cost) AS Software, SUM(cast(isnull(m.cost,0)as int)) AS Material,

    SUM(t.cost) AS Travel, SUM(h.cost) AS Hardware

    FROM THardware AS h

    LEFT OUTER JOIN TProject AS p ON h.idProject = p.idProyect

    LEFT OUTER JOIN TSoftware AS...

  • RE: Newbie question for small query

    Mayank Khatri (4/27/2009)


    Run Below:

    SELECT p.name, SUM(s.cost) AS Software, SUM(cast(isnull(m.cost,0)as int)) AS Material,

    SUM(t.cost) AS Travel, SUM(h.cost) AS Hardware

    FROM THardware AS h

    LEFT OUTER JOIN TProject AS...

  • RE: Newbie question for small query

    Hi thanks for the quick response!

    Can you please try cleaning up again the DB and trying with these values?

    Insert into TProject values ('test',1000,'2008')

    Insert into TSoftware values(1,'april',2000,'test','MS')

    Insert into THardware values (1,'april',10000,'test','test')

    Insert...

  • RE: Newbie question for small query

    Hi everyone,

    This is the script of creating the objects in the database, the database is called "Example":

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id...

  • RE: Newbie question for small query

    Hi again, I did some test to check and this are my results:

    1. I deleted all software, hardware, material and travel records.

    2. I inserted 1000$ for project TEST in the...

  • RE: Newbie question for small query

    Hi, thanks for responding so quickly!

    There is more than one hardware value for each project. For example suppose I have a project named TEST. In the hardware table there can...

  • RE: Newbie question for small query

    I tried with the left join but the SUM is still not correct, I check the expected result thousands of times but it still dont match. I also check and...

Viewing 11 posts - 1 through 11 (of 11 total)