help with query

associates

Registered User.
Local time
Today, 11:00
Joined
Jan 5, 2006
Messages
94
Hi,

I was wondering if anyone might be able to help me.

I need help to solve this issue. i have a query that returns records. The query is as follows

SELECT PSQuery.System_Name, PSQuery.Purpose, ProjectQuery.Project_Name, ProjectQuery.Completion_Date, [Framework Outline].Objective, PSQuery.PN_ID, ProjectQuery.[2008/9], ProjectQuery.[2009/10], ProjectQuery.[2010/11], ProjectQuery.[2011/12], ProjectQuery.[2012/13]
FROM (ProjectQuery INNER JOIN PSQuery ON ProjectQuery.PS_ID=PSQuery.PS_ID) INNER JOIN [Framework Outline] ON PSQuery.FO_ID=[Framework Outline].FO_ID
...

My question is how do i make sure the query returns only if the sum of [2008/9], [2009/10], [2010/11] > 0.

I have tried to sum those number in the query but i had to group by PSQuery.System_Name, PSQuery.Purpose, ProjectQuery.Project_Name, ProjectQuery.Completion_Date, [Framework Outline].Objective, PSQuery.PN_ID, ProjectQuery.[2008/9], ProjectQuery.[2009/10], ProjectQuery.[2010/11], ProjectQuery.[2011/12], ProjectQuery.[2012/13] in order to make the sum work, but then i got funny, weird characters for PSQuery.Purpose.

Is there a better way of doing this?

Thank you in advance
 
Hi again,

Is it possible to sum up more than one field in SQL query

For example
Sum(Projects.[2008/9]) AS [SumOf2008/9], Sum(Projects.[2009/10]) AS [SumOf2009/10],...

is it possible to do sum(Projects.[2008/9],Projects.[2009/10])? I tried this and it returns error. Maybe it's a cannot do thing.

Thank you in return
 
Try this:

sum(sum(Projects.[2008/9])+sum(Projects.[2009/10]))

~Moniker
 

Users who are viewing this thread

Back
Top Bottom