PC Review


Reply
Thread Tools Rate Thread

count records

 
 
Dan
Guest
Posts: n/a
 
      18th Sep 2003
i have a report similiar to the data below
Bank No. records
abc mtg 2
abc mortgage 10
abr mortgage 10
abr mortg. 15

i have a few hundred lenders which are the same but the
spelling is different and i want to count the number of
records for each is this possible

abc mtg/mortgage = 12
abr mortgage/mortg. = 25

 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      18th Sep 2003
"Dan" <(E-Mail Removed)> wrote in message
news:0e7801c37e1f$a7a0b900$(E-Mail Removed)
> i have a report similiar to the data below
> Bank No. records
> abc mtg 2
> abc mortgage 10
> abr mortgage 10
> abr mortg. 15
>
> i have a few hundred lenders which are the same but the
> spelling is different and i want to count the number of
> records for each is this possible
>
> abc mtg/mortgage = 12
> abr mortgage/mortg. = 25


It seems to me that you need to identify the specific words you want to
consider as equivalent. You could then have a function that returns an
adjusted lender name, like this:

Function fncAdjustedLenderName(LenderName As Variant) As Variant

Dim strAdjustedName As String

If IsNull(LenderName) Then Exit Function

strAdjustedName = Replace(LenderName, "mortgage", "mtg")
strAdjustedName = Replace(strAdjustedName , "mortg.", "mtg")
strAdjustedName = Replace(strAdjustedName , "mortg", "mtg")
strAdjustedName = Replace(strAdjustedName , "mtg.", "mtg")

fncAdjustedLenderName = strAdjustedName

End Function

Then you would use this function in a totals query like this:

SELECT
fncAdjustedLenderName(LenderName) As Lender
Count(*) As RecordCount
FROM BankData
GROUP BY fncAdjustedLenderName(LenderName);

All this is off the top of my head, but you get the idea, I hope.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to count records using count(*) in a chart report FL Microsoft Access Reports 3 3rd Dec 2009 03:51 PM
RE: How to count records using count(*) in a chart report FL Microsoft Access Reports 3 1st Dec 2009 11:31 PM
SIMPLE QUESTION MAYBE? need to count records BUT only records that Keith Microsoft Access 2 4th May 2009 10:01 PM
enter a count function to count records? Kimberly Microsoft Access Queries 11 14th May 2008 07:39 AM
Records Count and Records Navigation Control =?Utf-8?B?SEVMUE1FTUVNRQ==?= Microsoft Access Form Coding 0 19th Jul 2007 06:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:33 PM.