Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. JustABob

    Query Help

    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)...
  2. JustABob

    Query Help

    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?
  3. JustABob

    Query Help

    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...
  4. JustABob

    Query Help

    Is this one a lost cause?
  5. JustABob

    Query Help

    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...
  6. JustABob

    Creating an ID or counter

    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.
  7. JustABob

    Creating an ID or counter

    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...
  8. JustABob

    question about sums.

    alright, thanks for the help!
  9. JustABob

    question about sums.

    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...
  10. JustABob

    question about sums.

    I gave that a shot, and it still had the numbers off by a little bit. Thanks for the tip about the having though!
  11. JustABob

    question about sums.

    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...

Part and Inventory Search

Back
Top