Viewing 11 posts - 1 through 11 (of 11 total)
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...
April 29, 2009 at 11:56 am
Yes sorry, my bad! I already edited my last post:-D. Thanks a lot for the help!
April 28, 2009 at 8:26 am
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...
April 28, 2009 at 8:20 am
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...
April 27, 2009 at 2:07 pm
Mayank Khatri (4/27/2009)
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...
April 27, 2009 at 1:18 pm
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...
April 27, 2009 at 10:23 am
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...
April 27, 2009 at 9:45 am
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...
April 21, 2009 at 12:03 pm
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...
April 21, 2009 at 11:19 am
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...
April 21, 2009 at 10:20 am
Viewing 11 posts - 1 through 11 (of 11 total)