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 number of times text in records



 
 
Thread Tools Display Modes
  #1  
Old June 3rd, 2010, 05:48 PM posted to microsoft.public.access.queries
gator
external usenet poster
 
Posts: 166
Default COUNT number of times text in records

I have a field of names where there are multiple records of the same name. I
want to run a query on this showing a field of the name and a field of the
number of time it is listed in the dataset. What SQL will do this? I've
done it in Excel Pivot but I don't know how to convert it to SQL.
  #2  
Old June 3rd, 2010, 05:55 PM posted to microsoft.public.access.queries
gator
external usenet poster
 
Posts: 166
Default COUNT number of times text in records

something like......

TRANSFORM Count(Debits.[Name]) AS [CountOfName]
SELECT Debits.Name, Count(Debits.[Name]) AS NameTotal
FROM Debits
GROUP BY Debits.Name
PIVOT Debits.NameTotal;

.....this is as close as I can get but it doesn't work.

"gator" wrote:

I have a field of names where there are multiple records of the same name. I
want to run a query on this showing a field of the name and a field of the
number of time it is listed in the dataset. What SQL will do this? I've
done it in Excel Pivot but I don't know how to convert it to SQL.

  #3  
Old June 3rd, 2010, 06:00 PM posted to microsoft.public.access.queries
gator
external usenet poster
 
Posts: 166
Default COUNT number of times text in records

the following SQL works, but it shows the Name as row header and field
header. I don't nee or want the field header....just the fields Name and
Total of Name......?

TRANSFORM Count(Debits.[Name]) AS [CountOfName]
SELECT Debits.Name, Count(Debits.[Name]) AS [Total Of Name]
FROM Debits
GROUP BY Debits.Name
PIVOT Debits.Name;


"gator" wrote:

I have a field of names where there are multiple records of the same name. I
want to run a query on this showing a field of the name and a field of the
number of time it is listed in the dataset. What SQL will do this? I've
done it in Excel Pivot but I don't know how to convert it to SQL.

  #4  
Old June 3rd, 2010, 06:25 PM posted to microsoft.public.access.queries
gator
external usenet poster
 
Posts: 166
Default COUNT number of times text in records

never mind...I got it

"gator" wrote:

I have a field of names where there are multiple records of the same name. I
want to run a query on this showing a field of the name and a field of the
number of time it is listed in the dataset. What SQL will do this? I've
done it in Excel Pivot but I don't know how to convert it to SQL.

 




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 06:52 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.