473,830 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with counting occurances of similar text

Hi all,

I have a fairly simple database containing details of broadcast news
reports. Each record contains information about the programme title, date,
time, presenter, and details of the interviewees (if any) who contributed to
a particular report.

What I need to be able to do is count up instances of repeated text within
the database. For example, I would like to be able to run a query which
would provide a list of all the various programme presenters, and how many
reports they each presented.

e.g.

John Humphrys 54
Sarah Montague 56
Mark Coles 22
I also need to set up a more complex query, relating to interviewees and
guests. Contributors to each separate news report are set out in this
format:

Contributor1_N: Name of Interviewee
Contributor1_P: Political Party
Contributor1_IS : Interview or Soundbite

Contributor2_N: Name of Interviewee
Contributor2_P: Political Party
Contributor2_IS : Interview or Soundbite
(There is space for up to eight separate contributors, all set out in the
same way).

How would I, for example, write a query which gives a total for contributors
from, say, the Labour Party? Presumably I would have to somehow add up
occurrences of the phrase 'Labour Party' from Contributor1_P to
Contributor8_P ….

I think what might suit me best would be a query which would list every
possible input in all of the eight Contributor_P categories , and give a
total next to it.

e.g.

Labour Party 65
Conservative Party 54
Liberal Democrats 26
Green Party 1
Scottish National Party 1

I realise I've probably constructed the database poorly in the first place,
but would very much appreciate it if anyone could offer me some help,
explained in very simple terms if possible.

Many thanks

Andrew, (Brighton, UK)
Nov 13 '05 #1
1 1660
Have a look at the 'like' operator in Access Help. Used in
a query that should get a result set which you can then use
the Count() function on.

Do it in stages, design the query to get the results you
want then muck about with count() to get the numbers you
want. Count() is in the help as well.

Good luck

--
Nick Coe (UK)
Available - Will work for money :-)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ Online Store

In news:n_******** ************@gi ganews.com,
remove ntlworld.com typed:
Hi all,

I have a fairly simple database containing details of
broadcast news reports. Each record contains information
about the programme title, date, time, presenter, and
details
of the interviewees (if any) who contributed to a
particular
report.

What I need to be able to do is count up instances of
repeated
text within the database. For example, I would like to be
able to run a query which would provide a list of all the
various programme presenters, and how many reports they
each
presented.

e.g.

John Humphrys 54
Sarah Montague 56
Mark Coles 22
I also need to set up a more complex query, relating to
interviewees and guests. Contributors to each separate
news
report are set out in this format:

Contributor1_N: Name of Interviewee
Contributor1_P: Political Party
Contributor1_IS : Interview or Soundbite

Contributor2_N: Name of Interviewee
Contributor2_P: Political Party
Contributor2_IS : Interview or Soundbite
(There is space for up to eight separate contributors, all
set
out in the same way).

How would I, for example, write a query which gives a
total
for contributors from, say, the Labour Party? Presumably
I
would have to somehow add up occurrences of the phrase
'Labour
Party' from Contributor1_P to Contributor8_P ..

I think what might suit me best would be a query which
would
list every possible input in all of the eight
Contributor_P
categories , and give a total next to it.

e.g.

Labour Party 65
Conservative Party 54
Liberal Democrats 26
Green Party 1
Scottish National Party 1

I realise I've probably constructed the database poorly in
the
first place, but would very much appreciate it if anyone
could
offer me some help, explained in very simple terms if
possible.

Many thanks

Andrew, (Brighton, UK)

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1714
by: jabailo | last post by:
Which would be faster for counting lines in a StreamReader: (a) iterate through a file using .ReadLine() and adding to a counter, i++ (b) doing a .ReadToEnd() and then using an IndexOf() method to count the occurances of \r\n (c) doing a .ReadToEnd() and using a RegEx to count the number of occurances of \r\n
2
1238
by: Peter | last post by:
What is the most efficient way to count occurances of charaters in a string? IE. Searching for ',' in a comma del file.
2
5497
by: Jason Barnett | last post by:
I thought I had seen a method for returning the number of occurances of a substring within a string object, but I can't seem to find it now. Does anyone know of something? I know I can parse the substrings and count them using a loop, but I'm looking for a single function or method to simplify the process.
66
5424
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it occurs. After the program has read the file, it should offer a menu with three choices. the first is to list all the words along with the number of occurences. The second is to let you enter a word, with the program reporting how many times the...
4
2212
by: naknak4 | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will implement all three techniques as programs. In these programs, as well as solving the problem, you will also measure how long the program takes to run. The programs are worth 80% of the total mark. The final 20% of the marks are awarded for a...
6
2135
by: naknak | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will implement all three techniques as programs. In these programs, as well as solving the problem, you will also measure how long the program takes to run. The programs are worth 80% of the total mark. The final 20% of the marks are awarded for a...
10
1580
by: supercrossking | last post by:
I am trying to the values of string of text in the sample before. The ds are for digits and s is for string and string of text is for a string with more than one or two values. I am trying to use regex and the .groups method. Please help. d|d|d|string of text 1||s|s|||dd.dd|ss|string of text 2||||||||||||||||||||||||||string of text 2 I only want string of text1
0
9793
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10774
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
6950
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5617
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.