A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count of contents in field



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 01:53 PM
hermie
external usenet poster
 
Posts: n/a
Default Count of contents in field

In my table I have 20 field which can contains a value from A to F or Blank
In a query I want to count the total of the fields for instance:
Field1 = A
Field2 = B
Field3 = A
Field4 = F
Field5 =
Field6 =
Field7 = D

Total = 5

Help me please to perform this calculation

Herman



  #2  
Old May 25th, 2004, 06:43 PM
Mark
external usenet poster
 
Posts: n/a
Default Count of contents in field

Hermie,

Count = iif(Field1 is not null,1,0) + iif(Field2 is not
null,1,0) + ...

Better yet, you may wish to re-think the table design,
especially if you do not have to store values for each
question/score/grade or whatever it is.

Mark
-----Original Message-----
In my table I have 20 field which can contains a value

from A to F or Blank
In a query I want to count the total of the fields for

instance:
Field1 = A
Field2 = B
Field3 = A
Field4 = F
Field5 =
Field6 =
Field7 = D

Total = 5

Help me please to perform this calculation

Herman



.

  #3  
Old May 25th, 2004, 06:45 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Count of contents in field

If you want to count the number of non-null fields in a record then use an
expression like:
=IsNull(Field1) + IsNull(Field2) + IsNull(Field3) + ...IsNull(Field20) + 20

An expression like this generally suggests an un-normalized table structure.
--
Duane Hookom
MS Access MVP


"hermie" wrote in message
...
In my table I have 20 field which can contains a value from A to F or

Blank
In a query I want to count the total of the fields for instance:
Field1 = A
Field2 = B
Field3 = A
Field4 = F
Field5 =
Field6 =
Field7 = D

Total = 5

Help me please to perform this calculation

Herman





  #4  
Old May 25th, 2004, 08:12 PM
Herman
external usenet poster
 
Posts: n/a
Default Count of contents in field

Thanks Duane you help me great Can you also reassign my handle in tek-tips
too?
"Duane Hookom" wrote in message
...
If you want to count the number of non-null fields in a record then use an
expression like:
=IsNull(Field1) + IsNull(Field2) + IsNull(Field3) + ...IsNull(Field20) +

20

An expression like this generally suggests an un-normalized table

structure.
--
Duane Hookom
MS Access MVP


"hermie" wrote in message
...
In my table I have 20 field which can contains a value from A to F or

Blank
In a query I want to count the total of the fields for instance:
Field1 = A
Field2 = B
Field3 = A
Field4 = F
Field5 =
Field6 =
Field7 = D

Total = 5

Help me please to perform this calculation

Herman








  #5  
Old May 26th, 2004, 01:18 AM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Count of contents in field

I'm not sure what you mean by "reassign my handle in tek-tips". Are you
looking for me to lobby to have you re-instated after getting the boot?

--
Duane Hookom
MS Access MVP


"Herman" wrote in message
.. .
Thanks Duane you help me great Can you also reassign my handle in tek-tips
too?
"Duane Hookom" wrote in message
...
If you want to count the number of non-null fields in a record then use

an
expression like:
=IsNull(Field1) + IsNull(Field2) + IsNull(Field3) + ...IsNull(Field20) +

20

An expression like this generally suggests an un-normalized table

structure.
--
Duane Hookom
MS Access MVP


"hermie" wrote in message
...
In my table I have 20 field which can contains a value from A to F or

Blank
In a query I want to count the total of the fields for instance:
Field1 = A
Field2 = B
Field3 = A
Field4 = F
Field5 =
Field6 =
Field7 = D

Total = 5

Help me please to perform this calculation

Herman










  #6  
Old May 27th, 2004, 03:11 PM
Herman
external usenet poster
 
Posts: n/a
Default Count of contents in field

Yes if that is possible, i have send several emails to tek-tips for a reason
why I have been banned.
I signed up with a new account and this also is banned, problably tek-tips
banned the IP address in my office?

Herman
"Duane Hookom" wrote in message
...
I'm not sure what you mean by "reassign my handle in tek-tips". Are you
looking for me to lobby to have you re-instated after getting the boot?

--
Duane Hookom
MS Access MVP


"Herman" wrote in message
.. .
Thanks Duane you help me great Can you also reassign my handle in

tek-tips
too?
"Duane Hookom" wrote in message
...
If you want to count the number of non-null fields in a record then

use
an
expression like:
=IsNull(Field1) + IsNull(Field2) + IsNull(Field3) + ...IsNull(Field20)

+
20

An expression like this generally suggests an un-normalized table

structure.
--
Duane Hookom
MS Access MVP


"hermie" wrote in message
...
In my table I have 20 field which can contains a value from A to F

or
Blank
In a query I want to count the total of the fields for instance:
Field1 = A
Field2 = B
Field3 = A
Field4 = F
Field5 =
Field6 =
Field7 = D

Total = 5

Help me please to perform this calculation

Herman













  #7  
Old May 27th, 2004, 05:08 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Count of contents in field

Tek-Tips has many possible reasons for banning individuals. They will ban
-students looking for others to do their homework projects,
-posters who advertise their services to prominently
-mis-behaving members
-misleading members
-...

I am not aware of why you got bounced. Any member can "red-flag" any message
and the forum owners will generally bounce a member without consulting the
moderators.

--
Duane Hookom
MS Access MVP
--

"Herman" wrote in message
...
Yes if that is possible, i have send several emails to tek-tips for a

reason
why I have been banned.
I signed up with a new account and this also is banned, problably tek-tips
banned the IP address in my office?

Herman
"Duane Hookom" wrote in message
...
I'm not sure what you mean by "reassign my handle in tek-tips". Are you
looking for me to lobby to have you re-instated after getting the boot?

--
Duane Hookom
MS Access MVP


"Herman" wrote in message
.. .
Thanks Duane you help me great Can you also reassign my handle in

tek-tips
too?
"Duane Hookom" wrote in message
...
If you want to count the number of non-null fields in a record then

use
an
expression like:
=IsNull(Field1) + IsNull(Field2) + IsNull(Field3) +

....IsNull(Field20)
+
20

An expression like this generally suggests an un-normalized table
structure.
--
Duane Hookom
MS Access MVP


"hermie" wrote in message
...
In my table I have 20 field which can contains a value from A to F

or
Blank
In a query I want to count the total of the fields for instance:
Field1 = A
Field2 = B
Field3 = A
Field4 = F
Field5 =
Field6 =
Field7 = D

Total = 5

Help me please to perform this calculation

Herman















 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.