G
Guest
I have a database which I am writing Crystal Reports off. There are 3 or 4
tables with about 300,000 rows in each. Each table has the following key
fields:
Fund
Center
Account
Balance
I have written a query to create a unique field for each record
FCA which is Fund+Center+Account
I also need to create a table which assigns a row for each record in the
reports so I can group off them, ie Property taxes, Local sales taxes,
Licenses and permits and so forth. There are about 100 different assignments
in each table. The if then statements begin simple but can get complex for
of the assignments. I was doing this with a make query table with the new
field called "Combined Governmental Reports". I had it working with the IIF
command but after about 6 or 7 passes it wouldn't take any more statements.
It looked like this:
IIF ([Modified accrual balances with FCA]![Center} like "Z*"," ",
IIF ([Modified accrual balances with FCA]![Account] Like "411*","Property
taxes",
IIF ([Modified accrual balances with FCA]![Account] Like "412*","Local sales
taxes",
IIF ([Modified accrual balances with FCA]![Account] Between "413000" and
"414999","Licenses and permits"," "))))
I am guessing that I need to write this in visual Basic to get all the
statements in as well as having someone maintain it easily. About a year
ago, I was able to write quite a bit of Visual Basic code in reports and
forms (with MUCH help from this board) however I need help getting started
writing it in this query.
Can anyone spare a few moments to get me started or show me where I am
heading in the wrong direction? I'd sure appreciate it!
Thanks,
Meg
tables with about 300,000 rows in each. Each table has the following key
fields:
Fund
Center
Account
Balance
I have written a query to create a unique field for each record
FCA which is Fund+Center+Account
I also need to create a table which assigns a row for each record in the
reports so I can group off them, ie Property taxes, Local sales taxes,
Licenses and permits and so forth. There are about 100 different assignments
in each table. The if then statements begin simple but can get complex for
of the assignments. I was doing this with a make query table with the new
field called "Combined Governmental Reports". I had it working with the IIF
command but after about 6 or 7 passes it wouldn't take any more statements.
It looked like this:
IIF ([Modified accrual balances with FCA]![Center} like "Z*"," ",
IIF ([Modified accrual balances with FCA]![Account] Like "411*","Property
taxes",
IIF ([Modified accrual balances with FCA]![Account] Like "412*","Local sales
taxes",
IIF ([Modified accrual balances with FCA]![Account] Between "413000" and
"414999","Licenses and permits"," "))))
I am guessing that I need to write this in visual Basic to get all the
statements in as well as having someone maintain it easily. About a year
ago, I was able to write quite a bit of Visual Basic code in reports and
forms (with MUCH help from this board) however I need help getting started
writing it in this query.
Can anyone spare a few moments to get me started or show me where I am
heading in the wrong direction? I'd sure appreciate it!
Thanks,
Meg