I have a query problem that I would like some help on. I need to create a query from a transaction table. The table has ref(reference number), trd(date), trt(total), and trc(code). I can create a query that has MTD or YTD but not both at the same time. In order to get a true total I must also add up all of the totals for trc = "I" and subtract everything else. If anyone can help I would really appreciate it.


+-----------+------------+--------+-----+
| ref | trd | trt | trc |
+-----------+------------+--------+-----+
| 449181244 | 2004-10-01 | 54.26 | I |
| 449181245 | 2004-10-01 | 13.31 | I |
| 449181246 | 2004-10-01 | 25.72 | 0 |
| 449181247 | 2004-10-01 | 3.20 | I |
| 449181248 | 2004-10-01 | 16.99 | M |
| 449181248 | 2004-10-01 | 20.46 | I |
| 449181249 | 2004-10-01 | 11.57 | 0 |
+-----------+-------------+-------+----+