Like Count

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to count and number of like Items. So if I had a 1D1B, 1D2F, and
1D1D I would get 2. I think that Im close but I keep getting and error. I
tried =Abs(Sum([RSID]=Like "1D1*")) and that did not work.

Any help would be great.

Keith
 
Not sure why you are using Abs(), not sure why you are summing the ID#
(Sum([RSID]...).

Don't you want a Count of RSID's that are Like "1D1" & *?

Are you using a "Totals" query?

Good luck

Jeff Boyce
<Access MVP>
 
KAnoe said:
I would like to count and number of like Items. So if I had a 1D1B, 1D2F, and
1D1D I would get 2. I think that Im close but I keep getting and error. I
tried =Abs(Sum([RSID]=Like "1D1*")) and that did not work.


That's exactly the expression I would have suggested. What
about it did not work? Are you sure that RSID is the name
of a field in the report's record source table/query and not
the name of a control on the report?
 
Marshall Barton said:
KAnoe said:
I would like to count and number of like Items. So if I had a 1D1B, 1D2F,
and
1D1D I would get 2. I think that Im close but I keep getting and error. I
tried =Abs(Sum([RSID]=Like "1D1*")) and that did not work.


That's exactly the expression I would have suggested. What
about it did not work? Are you sure that RSID is the name
of a field in the report's record source table/query and not
the name of a control on the report?

I think the equal sign in front of Like is the problem.

=Abs(Sum([RSID] Like "1D1*"))
 
KAnoe said:
I would like to count and number of like Items. So if I had a 1D1B, 1D2F,
and
1D1D I would get 2. I think that Im close but I keep getting and error. I
tried =Abs(Sum([RSID]=Like "1D1*")) and that did not work.

"Marshall Barton" wrote
That's exactly the expression I would have suggested. What
about it did not work? Are you sure that RSID is the name
of a field in the report's record source table/query and not
the name of a control on the report?
Douglas said:
I think the equal sign in front of Like is the problem.

=Abs(Sum([RSID] Like "1D1*"))


Aw bleep, I missed that. Almost as bad, I didn't think of
using Left as Duane suggested.

It's good to know that you guys are covering my blind spots.
 
Thank you all. I will try it today and let you know. I will be using it on a
report header. I have a total of 6 Like 1d1, 1d2 and so on. Each one has
about 10 Sub IDs. What I'm working on is at the header of the report the iser
can just see the total of each ID and if he.she would like to look at the
details the he could.

Duane Hookom said:
You can't use "=like"
=Abs(Sum(Left([RSID],3)="1D1"))

--
Duane Hookom
MS Access MVP
--

KAnoe said:
I would like to count and number of like Items. So if I had a 1D1B, 1D2F,
and
1D1D I would get 2. I think that Im close but I keep getting and error. I
tried =Abs(Sum([RSID]=Like "1D1*")) and that did not work.

Any help would be great.

Keith
 
Duane

I'm confused (tell me something new!). I tried using the Sum() function on
a field that held text and it didn't work (type mismatch, if I recall).
Which version are you using?

Thanks!

Jeff Boyce
<Access MVP>

Duane Hookom said:
You can't use "=like"
=Abs(Sum(Left([RSID],3)="1D1"))

--
Duane Hookom
MS Access MVP
--

KAnoe said:
I would like to count and number of like Items. So if I had a 1D1B, 1D2F,
and
1D1D I would get 2. I think that Im close but I keep getting and error. I
tried =Abs(Sum([RSID]=Like "1D1*")) and that did not work.

Any help would be great.

Keith
 
He would appear not to be using Sum on a text field, but rather on the
result of the boolean comparison Left([RSID],3)="1D1"

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Jeff Boyce said:
Duane

I'm confused (tell me something new!). I tried using the Sum() function
on
a field that held text and it didn't work (type mismatch, if I recall).
Which version are you using?

Thanks!

Jeff Boyce
<Access MVP>

Duane Hookom said:
You can't use "=like"
=Abs(Sum(Left([RSID],3)="1D1"))

--
Duane Hookom
MS Access MVP
--

KAnoe said:
I would like to count and number of like Items. So if I had a 1D1B,
1D2F,
and
1D1D I would get 2. I think that Im close but I keep getting and error. I
tried =Abs(Sum([RSID]=Like "1D1*")) and that did not work.

Any help would be great.

Keith
 
Oho!

Thanks, Doug!

(Why not use Count()?)

Jeff Boyce
<Access MVP>

Douglas J. Steele said:
He would appear not to be using Sum on a text field, but rather on the
result of the boolean comparison Left([RSID],3)="1D1"

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Jeff Boyce said:
Duane

I'm confused (tell me something new!). I tried using the Sum() function
on
a field that held text and it didn't work (type mismatch, if I recall).
Which version are you using?

Thanks!

Jeff Boyce
<Access MVP>

Duane Hookom said:
You can't use "=like"
=Abs(Sum(Left([RSID],3)="1D1"))

--
Duane Hookom
MS Access MVP
--

I would like to count and number of like Items. So if I had a 1D1B,
1D2F,
and
1D1D I would get 2. I think that Im close but I keep getting and
error.
I
tried =Abs(Sum([RSID]=Like "1D1*")) and that did not work.

Any help would be great.

Keith
 
Answer: still need the WHERE clause.

(Thanks, Doug)

Jeff Boyce
<Access MVP>

Jeff Boyce said:
Oho!

Thanks, Doug!

(Why not use Count()?)

Jeff Boyce
<Access MVP>

Douglas J. Steele said:
He would appear not to be using Sum on a text field, but rather on the
result of the boolean comparison Left([RSID],3)="1D1"

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Duane

I'm confused (tell me something new!). I tried using the Sum() function
on
a field that held text and it didn't work (type mismatch, if I recall).
Which version are you using?

Thanks!

Jeff Boyce
<Access MVP>

You can't use "=like"
=Abs(Sum(Left([RSID],3)="1D1"))

--
Duane Hookom
MS Access MVP
--

I would like to count and number of like Items. So if I had a 1D1B,
1D2F,
and
1D1D I would get 2. I think that Im close but I keep getting and error.
I
tried =Abs(Sum([RSID]=Like "1D1*")) and that did not work.

Any help would be great.

Keith
 
Back
Top