I figured out what was wrong, I simply had 'and MAX(Contract_Amount)' and didnt put and clause on there like > 1000. The query will now run and looks like:
SELECT distinct
s.Company_Code, s.Master_Job, i.Job_Description
,Sum(s.Contract_Amount) 'Contract_Amount'
,Sum(s.Billed_JTD)...
Hmmm, I wasnt having much luck adding the max(contract_Amount) to the having clause. It kept erroring with:
Line 16: Incorrect syntax near ')'.
I havent used the having clause much before, is it pretty straight forward, or am I missing something?
Sorry about that, I should have had:
Sum(Contract_Amount) > 1,000,000 and (SUM(Contract_Amount) – SUM(Billed_JTD)) > 100 AND Sum(Total_Contract) = 0
#2,
I'd like this job to pull up under future. If the query could just consider the line with the largest contract amount when checking...
Sorry for the vague subject line, but I dont know the terms to describe this problem. As I've begun trying to use this data for reporting, I've been running into a few 'issues' as the users did not go for a standardized format. Anyways, I am working on a report and having trouble getting...
gmmastros, your solution worked great! I was already moving the data into a table from another table, so I was able to just add that column and things are now working prefectly!
Thanks for your help everyone.
Is there a way to create a unique ID to return in a rowset that is an integer?
I know there is the newID() function, but it returns something much larger and is non-numeric. What I am basically looking to do is return:
Select JobNumber, Name, StartDate, EndDate From Table
The thing is, this...
Sorry, I was refering to a differnt calculation I was working with. The main number I am trying to calculate is called GAP, I just used % for simplicity eariler. This is the code pre rollup that worked fine.
GAP =
CASE
WHEN Projected_Cost = '0' THEN 0
WHEN...
I am having some difficulties with this query and was wondering if anyone know what was wrong. The data I am working with can be setup 2 ways -
Master job only - all data on one line, perfect!
Sub Jobs and master job -
Data can be in the MJ line and the SJ line. I need to roll up all data...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.