=Count([Category] if it is equal to 'Task ID'"), how do I fix thi

  • Thread starter Thread starter Iram
  • Start date Start date
I

Iram

Hello,

I have a report with the fields "Date","Catgory","Amount" and I have grouped
it by "Date" by day.

For each day I need to Count the indivudual categories. There are
approximately 22 categories that the records are categorized by. So I figured
that I would need to create 22 text box's each with their own variation of
their category such as somthing along the lines of the below but I need your
help. Please. How do I fix these? I will be placing these text boxes in the
"Date Footer". Thanks.

=Count([Category] if it is equal to 'Task ID'")
=Count([Category] if it is equal to 'ASAP'")
=Count([Category] if it is equal to 'Pay Type'")
=Sum([Amount]= if Category = RLSD)
etc...



Thanks.
Iram/mcp
 
Marshal, your code worked for the first three examples I gave but now I need
a peice of code for this example...

=Sum([Amount]= if Category = RLSD)

I need to add up all of the money in the "Amount" field if the Category is
RLSD.

Can you help me with this too?


Thanks.
Iram



Marshall Barton said:
Iram said:
I have a report with the fields "Date","Catgory","Amount" and I have grouped
it by "Date" by day.

For each day I need to Count the indivudual categories. There are
approximately 22 categories that the records are categorized by. So I figured
that I would need to create 22 text box's each with their own variation of
their category such as somthing along the lines of the below but I need your
help. Please. How do I fix these? I will be placing these text boxes in the
"Date Footer".

=Count([Category] if it is equal to 'Task ID'")
=Count([Category] if it is equal to 'ASAP'")
=Count([Category] if it is equal to 'Pay Type'")
=Sum([Amount]= if Category = RLSD)
etc...

That's kind of ugly, but try this kind of thing:

=Abs(Sum(Category = 'Task ID'))

Personally, I think I would create a query to count the
categories by date. THen create a little report with the
new query as its record source and drio in into your
report's date footer. At least this way you will pick up
any new categories without having to modify your report.
 
=Sum([Amount] * Abs([Category] = "RLSD"))

--
Duane Hookom
MS Access MVP


Iram said:
Marshal, your code worked for the first three examples I gave but now I
need
a peice of code for this example...

=Sum([Amount]= if Category = RLSD)

I need to add up all of the money in the "Amount" field if the Category is
RLSD.

Can you help me with this too?


Thanks.
Iram



Marshall Barton said:
Iram said:
I have a report with the fields "Date","Catgory","Amount" and I have
grouped
it by "Date" by day.

For each day I need to Count the indivudual categories. There are
approximately 22 categories that the records are categorized by. So I
figured
that I would need to create 22 text box's each with their own variation
of
their category such as somthing along the lines of the below but I need
your
help. Please. How do I fix these? I will be placing these text boxes in
the
"Date Footer".

=Count([Category] if it is equal to 'Task ID'")
=Count([Category] if it is equal to 'ASAP'")
=Count([Category] if it is equal to 'Pay Type'")
=Sum([Amount]= if Category = RLSD)
etc...

That's kind of ugly, but try this kind of thing:

=Abs(Sum(Category = 'Task ID'))

Personally, I think I would create a query to count the
categories by date. THen create a little report with the
new query as its record source and drio in into your
report's date footer. At least this way you will pick up
any new categories without having to modify your report.
 
I love you guys, you guys are the bomb!
Thanks Duane!



Iram

Duane Hookom said:
=Sum([Amount] * Abs([Category] = "RLSD"))

--
Duane Hookom
MS Access MVP


Iram said:
Marshal, your code worked for the first three examples I gave but now I
need
a peice of code for this example...

=Sum([Amount]= if Category = RLSD)

I need to add up all of the money in the "Amount" field if the Category is
RLSD.

Can you help me with this too?


Thanks.
Iram



Marshall Barton said:
Iram wrote:
I have a report with the fields "Date","Catgory","Amount" and I have
grouped
it by "Date" by day.

For each day I need to Count the indivudual categories. There are
approximately 22 categories that the records are categorized by. So I
figured
that I would need to create 22 text box's each with their own variation
of
their category such as somthing along the lines of the below but I need
your
help. Please. How do I fix these? I will be placing these text boxes in
the
"Date Footer".

=Count([Category] if it is equal to 'Task ID'")
=Count([Category] if it is equal to 'ASAP'")
=Count([Category] if it is equal to 'Pay Type'")
=Sum([Amount]= if Category = RLSD)
etc...

That's kind of ugly, but try this kind of thing:

=Abs(Sum(Category = 'Task ID'))

Personally, I think I would create a query to count the
categories by date. THen create a little report with the
new query as its record source and drio in into your
report's date footer. At least this way you will pick up
any new categories without having to modify your report.
 
Back
Top