casey
03-08-2002, 02:57 PM
Hello,
I have a table: tblMonthly.
w/ fields:
fldID:Auto
fldDate http://www.access-programmers.co.uk/ubb/biggrin.gifate
fldType:Text(Revenue or Expense)
fldEstimate:$
I would like to subtract estimated revenues and expenses for one period. However, I would need to use two queries to do so.
1.)SELECT tblMonyhly.fldType, Sum(tblMonyhly.fldEstimate)
FROM tblMonyhly
GROUP BY tblMonyhly.fldDate, tblMonyhly.fldType
HAVING (((tblMonyhly.fldType)="revenue"))
ORDER BY tblMonyhly.fldDate;
2.)SELECT tblMonyhly.fldType, Sum(tblMonyhly.fldEstimate)
FROM tblMonyhly
GROUP BY tblMonyhly.fldDate, tblMonyhly.fldType
HAVING (((tblMonyhly.fldType)="expense"))
ORDER BY tblMonyhly.fldDate;
Is there a way to subtract these? I'm stumped.
Thanks.
[This message has been edited by casey (edited 03-08-2002).]
[This message has been edited by casey (edited 03-08-2002).]
[This message has been edited by casey (edited 03-08-2002).]
[This message has been edited by casey (edited 03-08-2002).]
[This message has been edited by casey (edited 03-09-2002).]
I have a table: tblMonthly.
w/ fields:
fldID:Auto
fldDate http://www.access-programmers.co.uk/ubb/biggrin.gifate
fldType:Text(Revenue or Expense)
fldEstimate:$
I would like to subtract estimated revenues and expenses for one period. However, I would need to use two queries to do so.
1.)SELECT tblMonyhly.fldType, Sum(tblMonyhly.fldEstimate)
FROM tblMonyhly
GROUP BY tblMonyhly.fldDate, tblMonyhly.fldType
HAVING (((tblMonyhly.fldType)="revenue"))
ORDER BY tblMonyhly.fldDate;
2.)SELECT tblMonyhly.fldType, Sum(tblMonyhly.fldEstimate)
FROM tblMonyhly
GROUP BY tblMonyhly.fldDate, tblMonyhly.fldType
HAVING (((tblMonyhly.fldType)="expense"))
ORDER BY tblMonyhly.fldDate;
Is there a way to subtract these? I'm stumped.
Thanks.
[This message has been edited by casey (edited 03-08-2002).]
[This message has been edited by casey (edited 03-08-2002).]
[This message has been edited by casey (edited 03-08-2002).]
[This message has been edited by casey (edited 03-08-2002).]
[This message has been edited by casey (edited 03-09-2002).]