none
Help with SQL query - Pulling last date and shift info RRS feed

  • Question

  • Hello,
    I'm a bit of a newbie to writing SQL queries, and trying my best, but I am stumped at one.

    We have a plant that takes inventories of our tanks twice per day. Each inventory take creates a new record for each tank, which includes "Date", "Shift", "TankNumber", "Material", "Pounds". am trying to make a gauge that looks at the last inventory take, so the lastest date and latest shift, and aggregates the pounds by material into a gauge.

    Example, last inventory take, there are 10 tanks that had the inventory taken on them. 6 of them had 10,000 each of  Material "A". Therefore I want the gauge to show "60,000".

    I hope this makes sense, and any help with either building the correct query up front, or filtering/aggregating on the gauge would be appreciated!

    Thanks,
    Chase

    Saturday, June 26, 2010 4:48 AM