Using SQL, is it possible to group records and sum quantities only if date is higher then specific date?
For example my table has records:
<tbody>
</tbody>
I would like to group them and get total and "Sum QTY where DATE >DEADLINE" to get
<tbody>
</tbody>
Don't worry about grouping them, I already did that, just not sure if it's possible to add part in Select and somehow define column "QTY after DEADLINE".
Thank you
For example my table has records:
ITEM | ORDER | QTY | DATE | DEADLINE |
I001 | P001 | 5 | 01.12.2015 | 05.12.2015 |
I001 | P001 | 3 | 10.12.2015 | 05.12.2015 |
I001 | P001 | 7 | 20.12.2015 | 05.12.2015 |
<tbody>
</tbody>
I would like to group them and get total and "Sum QTY where DATE >DEADLINE" to get
ITEM | ORDER | Total QTY | QTY after DEADLINE |
I001 | P001 | 15 | 10 |
<tbody>
</tbody>
Don't worry about grouping them, I already did that, just not sure if it's possible to add part in Select and somehow define column "QTY after DEADLINE".
Thank you