Results 1 to 19 of 19

Thread: Help with SQL statement

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2005
    Posts
    138

    Help with SQL statement

    I need help writing a sql stmt. Here’s what I’m trying to do:

    See attachement pic for tables

    I need to get the sum of sales and cost between two week # (say between week 48 of 2005 and week 2 of 2006), grouped by dept.
    I know I have to look up the dates in the calendar table, in order to use a bigger than and lesser than ..date.
    I didn’t put all the weeks in this example, but the table has 80,000 lines, so they’re all there. Same with the calendar, I have all dates.

    Can some of you sql guru give me a hand? Can’t be that difficult but I’m stuck with this and nothing I’ve tried works.

    Many thanks.
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width