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 Mike Lewis 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. nedrob

    Question about Datepart

    I am trying to create a query to return the Number of hours worked in the current week. However, I have two years of data and for some reason this query is pulling data from last year and not the current year. I'm new at this and am sure I'm probably overlooking the obvious. Thanks for any input...
  2. nedrob

    How can I compare years?

    I'm relatively new to Sql and have been working on the following problem for two weeks (I'm frustrated and throwing the towel in:). I need to add two fields to the following query. Any help would be greatly appreciated. 1. 'YTD vs. LYTD' = I need this to compare this year to date GMP$ to last...
  3. nedrob

    a problem with case

    I am relatively new to SQL programming and have been working on the following script, I would like to insert the following case statement into latter script. 'Temp YTD GM%' = ROUND(CASE WHEN SUM([Temp Billing MTD]) = 0 THEN '0' ELSE SUM([Temp GM$ MTD] / [Temp Sales MTD]) END, 2) I am...
  4. nedrob

    Divide by Zero - Help!

    You know this is so crazy it might work. I'll try it Thanks, Ron
  5. nedrob

    Divide by Zero - Help!

    Anybody know of any tricks that would prevent a "divide by zero" error which may occur in this query? This has been driving me nuts for days. I need to divide "GM YTD/Temp GM MTD" however some of these fields contain zero values and the obvious happens. BOL has not been a...
  6. nedrob

    Is this a job for datepart?

    thanks, this worked and was rather painless. I am in your debt. Ron
  7. nedrob

    Is this a job for datepart?

    The query I am working on needs a column that calculates week to date hours called: "WTD Hours" off of a field called "Bill_Hours". Sunday is always the week ending date. I am new to this and the date calculations mess me up. Thanks in advance for any insight. Ron CREATE...

Part and Inventory Search

Back
Top