Z
ZBC
I'm looking for help on solving this ...
What I need is the equivalent of some additional fields in a table, but
they would be calculated fields ... I don't think I want them to be part
of the actual tables. They could be part of a table, but I would be
duplicating information (even though my tables are less that 2000 records.
Basically, I need to take an expense field and create (divide up it's
value) based on it's value.
In the end:
Category1 + Category2 + Category3 + Category4 = Expenses
I created some IF statements (syntax may be wrong for VBA) to reflect
what I think I need to do.
If(Expenses <= Level1 THEN
Category1 = Expenses
EndIF
IIF((Expenses > Level1 AND Expenses <=Level2) THEN
Category1 = Level1
Category2 = Expenses-Level1
EndIF
IIF((Expenses > Level2 AND Expenses <=Level3)
Category1 = Level1
Category2 = Level2
Category3 = Expenses-(Level1+Level2)
EndIF
IIF((Expenses > Level3 AND Expenses <=Level4)
Category1 = Level1
Category2 = Level2
Category3 = Level3
Category4 = Expenses-(Level1+Level2+Level3)
I want to use the values of Category1,Category2, etc. in reports as
though they were fields.
Can I do this with a query?
Bob
What I need is the equivalent of some additional fields in a table, but
they would be calculated fields ... I don't think I want them to be part
of the actual tables. They could be part of a table, but I would be
duplicating information (even though my tables are less that 2000 records.
Basically, I need to take an expense field and create (divide up it's
value) based on it's value.
In the end:
Category1 + Category2 + Category3 + Category4 = Expenses
I created some IF statements (syntax may be wrong for VBA) to reflect
what I think I need to do.
If(Expenses <= Level1 THEN
Category1 = Expenses
EndIF
IIF((Expenses > Level1 AND Expenses <=Level2) THEN
Category1 = Level1
Category2 = Expenses-Level1
EndIF
IIF((Expenses > Level2 AND Expenses <=Level3)
Category1 = Level1
Category2 = Level2
Category3 = Expenses-(Level1+Level2)
EndIF
IIF((Expenses > Level3 AND Expenses <=Level4)
Category1 = Level1
Category2 = Level2
Category3 = Level3
Category4 = Expenses-(Level1+Level2+Level3)
I want to use the values of Category1,Category2, etc. in reports as
though they were fields.
Can I do this with a query?
Bob