Parsing Through A String And Counting Number Of Occurrence
Feb 12, 2013
I have about 150k rows that look like this
SHORT_DESCRIPTION
unable to view
unable to send out some stuff
what is going on
Is it possible for access to query through each field, and tell me the total number of occurence for each word? In this small example, the output would be:
Unable 2
to 2
view 1
send 1
out 1
some 1
stuff 1
what 1
is 1
going 1
on 1
Is this possible?
View Replies
ADVERTISEMENT
Jan 12, 2015
Here are the 2 tables that I am working with:
Account
Account
0041980041
0051670051
0052330052
0053490053
Conversion
Account Conversion
0041 10000151
0051 10000152
0052 10000153
0053 100001524
I need to update the Account table using the Conversion table by replacing the first 4 digits in the Account table with the Conversion value. For example, the first record should be updated from 0041980041 to 10000151980041.
View 4 Replies
View Related
May 1, 2015
I have to count the number of occurrences of Line feed (vbLf) in a long string. The code I am using is:
MAX = TLine.Split(vbLf).Length - 1
It does not work.
View 5 Replies
View Related
Feb 7, 2006
hi, im new to both access and sql and was hoping i could get some help...
i have a string of numbers seperated by commas stored in my database. i need to count how many numbers there are in each string and then display all the results with less than 36 numbers contained.
am i able to do this with an sql statement, or am i likely to need vba??
(example string: 9.89007472991943, 12.3332061767578, 14.4694166183472, 16.287145614624, 17.5347270965576, 17.6327610015869, 16.1364498138428, ...)
thx in advance
View 1 Replies
View Related
Aug 19, 2005
I have the following string: NE1220904
I need to remove the left two characters and the right four characters of a string in a query. I have found how to remove one side or the other, but not from both sides. Thanks in advance for the help!
View 6 Replies
View Related
Sep 3, 2007
:confused:
I have a Microsoft Access table with the following columns: A,B,C,D,E,F.
In first row of Column A, I have the following string value: "Al,Peggy,Kelly,Bud,Buck"
What I would like to do is parse this string as such:
Column B:"Al"
Column C:"Peggy"
Column D:"Kelly"
Column E:"Bud"
Column F:"Buck"
Is there a simple VB funtion to accomplish this?
View 1 Replies
View Related
Aug 13, 2015
I have a field in our database with five distinct strings, separated by a delimited (a slash or "/").
I've been able to successfully write the formula to parse the first field:
ARL: Left$([pipeline]![Short Description],InStr(1,[pipeline]![Short Description],"/")-1)
The second field:
BRANCHMGR: Mid(Left([pipeline]![Short Description],InStr(InStr(1,[pipeline]![Short Description],"/")+1,[pipeline]![Short Description],"/")-1),InStr(1,[pipeline]![Short Description],"/")+1)
and the last field:
DATE: Mid$([pipeline]![Short Description],InStrRev([pipeline]![Short Description],"/")+1)
how to get the third and fourth strings parsed. I know its going to include some nested InStr or InStrRev commands -- just having trouble figuring out the structure. Could potential need a LEN command as well.
Typical field might look like this:
"Name1/Name2/Description/Update/Date"
View 7 Replies
View Related
Oct 5, 2006
Okay, so I have a table, created from an action query which shows all orders for a specific RepID. One of the fields in this table is ProductName. There are many many prouct names in this table, and potentially many more as more product is added. Many of the names of the products are very very similar. what I want to do is create a query which calculates the number of occurrances of a certain string in the field ProductName... for example...
Some of the values in ProductName are
Exp
ExpUp
Exp/CHS
Dig
DigUp
DigDBB
Dig/CHS
etc.
What would be nice is if I can count the number of occurrances of, say "Exp" in the created table. I'm sitting here with help manuals and such and I'm completely stumped... I'd appreciate some bigger brains than mine taking a look at this one please... Thank you! :)
Lana F Call
View 3 Replies
View Related
Aug 13, 2004
Whats up all U brilliant people,
I am baffled again. I need to print a report that can count the number of entries in a database or query. Basically I am looking for the equivalent of the countA function in Excel. All advice is welcome.
Eternally Grateful,
Khepra
View 5 Replies
View Related
Feb 11, 2007
I've been searching the Queries Forum for help on this issue. I have a database that records loading records for a Taconite facility. Some days contain many records and on other days there are no records because of no loading activity. I create reports that group these loading records by each day, but I really need a quick and dirty report that just shows me the number of days in any month in which we had loading activity (records present). I have not figured out a way to create a query which counts the number of days in a month which contain records. I'm hope I'm explaining this well enough for someone to help me understand what to do.
Thanks ... Erik
View 5 Replies
View Related
Dec 7, 2006
How would i count the total number of records on a form
View 5 Replies
View Related
Nov 5, 2012
I need to count the number of entries for a particular item located in a table. To keep it simple, we have a database used to process orders for Turkeys, this database has a field for each order called "Long legged Weight". In order to sort the turkeys in the shed, we need to know how many of each weight there are.
Order Number / 10-12 / 11-13 / 12-14 / 13-15 / (etc)
......1 ................1
......2 ..........................1
......3 .....................................1
......4 ..........................1
Total ..................1 ......2 .........1
View 14 Replies
View Related
Sep 20, 2013
I have a table that tracks different events and the actual date they occurred. I am trying to write a query that counts the number of each event that occured by month. One issue I am having is if an event had no occurrence during a month I want to return 0 raher than no data for that event.
View 2 Replies
View Related
Aug 20, 2004
Hi all,
Is there any option to count the number or records relating to
a specific field. Here is the details..The db is for a school and there is a tables for
class and students. I am using a form to enter students details. I had created a
relationship with these two tables. i am using a query to get the details regarding a specific
class like classname, class teacher like that.. Is there any way to calculate the number of students in that specific class.
now i am using the query as follows
SELECT Class.*
FROM Class
WHERE (((Class.ClassID)=[Forms]![Class]![ClassID]));
I had created the relationship with the above two tables with classid as the primary key
thanks in advance
Thanks
View 1 Replies
View Related
Aug 24, 2004
Hello all. I need some help calculating the total number of records returned in a query anytime i run the query.
I have a form that creates an SQL statement and changes the querydef at runtime and displays the results in a listbox. I want to include on my form a percentage of the total records from the table based on the records returned in the query Ex. (5/10) so I can use this information on a report.
What I am trying to ultimately acheive is to calculate an attrition rate based on the number of (clients that leave in a given period / total new clients added in the given period )
thanks for your help!
tony-t
View 1 Replies
View Related
May 24, 2013
I'm after some code as to how to count a number of records within a table, I then want to have this number returned into a variable so I can determine usages with it, e.g. If the value is < 1 and using conditional statements.
View 1 Replies
View Related
Oct 22, 2013
I built the below query to count the number of ID's for each week. The problem is that if one month ends mid-week it is counting the next month's IDs in the first month. I need to count the number of IDs within each week by month. I have the first qryGroupbyWeek that assigns a week number to each date then the below query to aggregate.
Code:
SELECT qryGroupbyWeek.Week, qryGroupbyWeek.[Approved Date], qryGroupbyWeek.ID
FROM qryGroupbyWeek
WHERE (((qryGroupbyWeek.[Approved Date]) Between [start] And [end]))
ORDER BY qryGroupbyWeek.ID;
View 2 Replies
View Related
May 11, 2012
I have a query to calculate the monthly depreciation for a machine for specific period of time.
My problem is how to get the number of months for each period assuming i want to start from month September 2009 till may 2012.
Attached the data extracted by the query.
I want to calculate the depreciation to be grouped year by year in report.
[TD][TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
View 3 Replies
View Related
Mar 5, 2008
I have a spreadsheet and the only column that matters is D.
Down column D it appears as:
a
b
b
b
c
c
d
e
f
c
a
I need the result to just appear like
A - 2
B - 3
C - 3
D - 1
E - 1
F - 1
View 2 Replies
View Related
Sep 19, 2013
I have been tasked to create a DB for my unit. I have created a few DB, but I am a novice at best. I need a crosstab Query to count the number of records for each FY. The Army's FY is from Oct -Sep. I only need to show the the total number of record for the previous FY in a Report and on a form.
View 7 Replies
View Related
Oct 11, 2013
I'm creating a report for an imaginary "medical clinic's database", the intended function of which is described as follows: "Create a statistic that shows the total number of distinct drugs prescribed to a patient."
Where I'm at:
I've created a query called UniqueDrugs containing drug and patient info. The SQL is:
Quote:
SELECT DISTINCT Drugs.Drug_Name, Patients.[Patient _ID]
FROM Patients INNER JOIN (Drugs INNER JOIN Prescriptions ON Drugs.[Drug_ID] = Prescriptions.[Drug_ID]) ON Patients.[Patient _ID] = Prescriptions.[Patient_ID]
GROUP BY Drugs.Drug_Name, Patients.[Patient _ID]
ORDER BY Patients.[Patient _ID];
The results of this query seem to be what I need. All I need is for the count formula that I use to return the number of distinct drug names there are that are related to a patient's ID.
I've created a report and I've put the following formula into a text box:
=DCount("[Drug_Name]","[UniqueDrugs]","[Patient_ID]=[PID]")
Where PID is the name of another text box in the report that contains the Patient ID that I want to compare to the drug names returned by the query.
However, this *always* results in #Error, no matter how I change the formula.I have been led to believe that syntax is not the issue, as the following formula worked as intended for a different task:
=DCount("[Prescription_Date]","[UniqueYearQuery]","[Patient_ID]=[PID]")
How do I use a DCount to return the number of different drugs that have been prescribed to a patient?
If it did not require the number of different drugs, I would simply use the following formula, which works just fine:
=Count(Drug_Name)
View 6 Replies
View Related
May 27, 2014
I need to count the days that an item of equipment is used for the last week?
The problem comes if an item is deployed within the week i.e not used for the full week?
I have two fields - MobDate and DeMobDate
I have to create a third called NOD (number of days) which will display the number of days in the previous week that the item was hired out.
View 14 Replies
View Related
Jun 8, 2015
I want to use to count how many times a record is displayed in the period and lesson field, in another table, so that this data can be used to show how many people are attending a class. e.g how many times people are attending art 1, by counting how many times art one appeared in the first table.
View 1 Replies
View Related
Aug 11, 2015
I'm trying to run a line of code after doing a Query Search that reports back the total number of results pulled from the search. I've dug around and found some useful code, but nothing that gives the results I'm needing. Most everything gives me the total number from the query. I'm also using a Split Form.
The process goes: Enter numeric search in Text10 and hit the search button to run the following macro: [studentID]=[Forms]![Query1]![Text10]
It then gives me the requested information.I have a second text box (Text19) that needs to display the number of pulled results. I've written VBA that only gives me the total number searched for studentID or for the entire Query.
Can I simply add an additional line to the Macro?
View 7 Replies
View Related
Nov 7, 2013
I have an access dbase with a single table
I am interested in reporting so need totals, I can write a query that will count the number of machines in a dept like so
SELECT [Computer Inventory].Department, Count([Computer Inventory].ID) AS CountOfID
FROM [Computer Inventory]
GROUP BY [Computer Inventory].Department;
This works fine, however I now want to add more so are two fields
To_be_migrated
Is_migrated
These are just checkboxes so I assume criteria is true or false
I need a query which will give me
The total number of machines by dept
The total marked for migration
The total migrated
View 4 Replies
View Related
Nov 19, 2007
in the query design how can I extract a number out of string. ex
25 bp
234.56 bp
etc. ? I would have expected INT(FiledName) but it's not it
View 3 Replies
View Related