473,378 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 1638
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_********************@giganews.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
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...
2
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
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...
66
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...
4
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...
6
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...
10
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.