Counting 2 Columns/fields

Jul 17, 2006

I have been pulling my hair out over a query application and I'm looking for some help...

For instance, I have a table with [PrimaryName], [SecondaryName] and [JobDate]. I want a query that will display if there is more than one occurrence of the same name in either name field on the same date.

If it were just one field I could do this using GROUP BY and HAVING but because I need to check both name fields I'm stumped. I tried a union query but that seems to group multiple occurrences together as one entry.

Any help is appreciated.

View Replies


ADVERTISEMENT

Counting Columns And Storing Result In TxtBox

May 18, 2007

Hello,

In a form I have "txtBoxA". I would like store the number of records from table "A" based on a specific field into "txtBoxA".

Ex:
Table 'A' fields: QuoteID, Date, GenerateOrder

What would be the exact syntax for this??
The following code is not working

Me.txtBoxA.Value = DoCmd.RunSQL ("SELECT COUNT(GenerateOrder) FROM A")

Thanks

View 2 Replies View Related

Queries :: Counting Multiple Columns In A Query?

Apr 6, 2015

Student ID
Command over subject
Teaching Subject
Explaining things
Pedagogy Methods
Solicited_Participation_Class
1
Good
Average
Bad
Good
Bad
2
Bad
Average
Good
Bad
Good
3

[code]......

I have a table given above, table name is student. Which has following sample data.

I want to count the no. of students who say Good, Average ,Bad for every indicator Output from query:

Good
Average
Bad
Command over subject
2
3
1
Teaching Subject
1
5
0

[code]......

How this can be achived from query in MS Access 2010

View 4 Replies View Related

Queries :: Separating Values From Single Column Into Two Columns And Counting Them?

Oct 4, 2013

I have a table that has two columns "Nationality" and "Gender". I wanted to run a query that will Group the nationality and then split the gender column into two columns and after that it will count both gender columns for each nationality. When I posted this question in "Reports" section I got the suggestion to use the SELECT COUNT in SQL. It worked but only for nationality. I couldn't get it work for the Gender column. I searched alot and the only thing I got was the SQL function to split data from one column into two but that also didn't serve the purpose (check the link to see why: [URL]) At last, I went on to create a cross tab query. Selected Nationality as Row header, Gender as Column header and Customer ID as calculation point. And there I got the result I needed. The SQL Code looks like this:

Code:
TRANSFORM Count(Register.[Customer ID]) AS [CountOfCustomer ID]
SELECT Register.National, Count(Register.[Customer ID]) AS [Total Of Customer ID]
FROM Register
GROUP BY Register.National
PIVOT Register.P_Gender;

Crosstab query did the trick..

View 1 Replies View Related

Counting Fields On A Record

May 22, 2006

Hi does anybody know how to count all the fields on a record that have a value? Therefore not counting the fields with a null value. Im sure it has something to do with the TotalData expression. Thanks.

View 1 Replies View Related

Counting Text Fields

Mar 6, 2005

Can anyone tell me how to count (sum) text fields. My current query will search for:

1) Name

2) Ticket Number (ww*, beginning of one type of ticket)


And it works fine except that after running the query I have to manually add up how many of the ww tickets each person wrote. Is there a way to make it change the ww* tickets to a number, like 1, so that it can be added up or to add up by the persons name how many tickets they wrote. I'm using Access 2000.
Thanks

View 1 Replies View Related

Counting Occurrences Of Same Fields After A Query

Mar 14, 2006

I run a Query to determine how many employees attended a meeting, showing the number of years they have worked at the company.
(Example output of query)

Employee Name Years with Company
John Doe 3
Jane Smith 1
Bill Doe 3
Rick Mills 1

How do I count the number of people with each range or particular number of years with company? For example:
2 employees have 1 year with company
2 employees have 3 years with company

View 4 Replies View Related

Counting Fields In Access Tables

Dec 9, 2004

Hi

I am currently creating a report form which only calculates
fields/columns in my main table. However I am currently struggling
counting text fields and checked fields as well as data fields in this
table.

I want it to count all the "yes" checked fields in my main table targeting
another column's data e.g I've got column with Category listed as 1, 2, 3, 4 and 5.
Along with this there is a check box to say that a job was completed under cat. 1,
2, 3, 4 or 5.

I have managed to get the formula to cound all checked boxes in the databases,
but what about targeting only say category 1's checked boxes or category 2's checked
boxes. I need to work out %'s from these individual totals as well.

Any suggestions on this would be great!

Elza

View 14 Replies View Related

Problem With Counting Text Fields

May 18, 2005

I'm trying to build a query that will count items in a text field.

How do I do this. I know the statement should read something like this - SELECT COUNT([fieldname]) FROM [tablename] WHERE [fieldname]=yes;

Is this statement correct and where do I place it? Does it go in that specific column. Any help would be greatly appreciated.

Thank you in advance for your assistance.

View 6 Replies View Related

Forms :: Counting How Many Fields Have A Specific Value

Nov 16, 2014

I have 7 combos, which for the most part set the value in another field - however, there are two values in the combo that do not have a value attached - one is AH, the other is SK. I have two textboxes (one for AH, one for SK) that I wish to have a count (preferably running) of how many times each of these values appears in the seven combo boxes.

View 5 Replies View Related

Queries :: Counting Multiple Yes / No Fields

Apr 26, 2013

I have a table, which is being populated by a number of users. The table has 211 rows (customer field - this is a fixed amount) and there are 5 other columns (information which might or might not be available for that customer) which are all yes/no fields. Each row may could have any combination of ticks in those 5 columns.

I have a form to fill out this information, but now I need to use the data.

I'm trying to create one query which counts how many of each field are populated. I need it to give me the total of each of the "information" columns, and another to give me a list of all of the customers which have at least one of the information columns ticked.

I will also need to be able to see how many customers have all of the information columns ticked, and how many have none.

View 1 Replies View Related

Counting Month Fields For The Current Year?

Nov 4, 2007

Hiya

This is my first post here, but I've two questions so I'll divide it into two threads.

Normally I can google these to help find the answers but a bit of a loss at this one, probably beginners stuff to some of you.

Heres a link to the database below

http://casp.gamecommunity.co.uk/database.gif

Total count is easy: =Count(tblMain!ID1)

What I want to do is count the amount of records for each individual month of the current year so I don't have to change the year date everytime a new year comes round. As soon as the next year comes around they all reset to 0.

The clever way would be to count the records for the current month -1 current month -2 etc and automatically update the month labels but I think that would be getting a bit comlicated.

Thanks in advance for any help. :)

View 6 Replies View Related

Formula Counting Fields In Either Query Or Report

Dec 15, 2004

Hi

I would like to count number of items witin a text field,
but breaking it down identifying the different items within the
text field.

e.g.

Got a field with fruits listed. Now I am identifying the fruit but want
to know how many rotten fruit there was for each specified fruit.

At the moment my query is by date and the fruit including the column
specifying if the fruit is rotten or not. But there is 3 options in the last
column. How can I count this last column to count how many of these
3 options there are for each fruit in my report?

Please let me know if this makes any sense or not otherwise I will try to explain
it a little bit better.

View 1 Replies View Related

Reports :: Blank Fields - Counting Times?

Feb 12, 2014

I have a report that is pulling data from a query and on the report, i have a controlled field that is supposed to count only data where a field says "no". Here is the string.

=Sum(IIf([Caller Used Resources]="No",1,0))

when i run the report i get the four results that say no, but i also get a blank field counting the times when this field is blank. If this field is blank, i don't want it to show anything.

View 1 Replies View Related

Reports :: Several Fields In Report - Counting Record Values

May 10, 2014

Suppose we have a report that outlines several fields, one field shows the City. In the report, this week, we see 10 records "New York", 8 records "Houston", 7 records "London", 3 records "Paris" and so on.

Next week's report outlines different cities and different number of records. I need to have in the report footer a "recapitulation" , a field that would say :

New York 10
Houston 8
London 7
Paris 3

Total 28

Next week cities and number of records might not be the same, we may have

Tokyo 12
Singapore 14
New York 6
London 7

Can i make my report in that way that it will count the values without using VBA ? I tried the count values option but it counts the overall report, does not take into consideration the different values.

View 2 Replies View Related

Modules & VBA :: Ignore Date Fields In Table When Counting Records?

Jun 6, 2014

Suppose I have a table with a variety of fields; one autonumber, some text fields and some date fields.

I need code to calculate the number of fields that are NOT date fields and then code to count how many of those fields (the ones that are not date fields) have data in them.

Following is the code to count how many fields in a table had data and this works well, but now I need to find a way to ignore the date fields. How can this code be modified to do the same but ignore the date fields?

Code:
Public Function PercentCompleted(Table As String, IDProject As Long, TotalFields As Single) As Double

Dim sampO As DAO.Recordset, iCtr As Long, strSQL As String, Percent As Double
'Takes the fields based on the projectID
strSQL = "SELECT *" & _
"FROM " & Table & " WHERE IDProject = " & IDProject
Set sampO = CurrentDb.OpenRecordset(strSQL)

[code]....

View 13 Replies View Related

Bind Columns (Fields)

Aug 2, 2005

I have been looking on the forum for some code that would bind all columns (fields) starting from column 15 to 26 to a combo box



for example....



Field 1 Field 2 Field 3 Field 4

data1 data2 data3 nodata



Combobox

data 1

data 2

data 3





kind of like a grid

based on the record I select in my form the combo box will show the columns that have data for that record.



It is trycky but I have no idea how to get that started





Thank you all for your help

View 4 Replies View Related

Max Columns/Fields In A Query

Nov 28, 2007

Could anyone tell me if there's a hardcoded maximum number of fields/columns in a query?

I ask, because through some experimentation and the urging of others on the boards, I've finally taken a look at the SQL view of a database and found it rather easy to understand. There, I found I had more flexibility filtering a Query via SQL in comparison to the query design window. (unlimited "Or" vs. 8).

So, even though there's a definite number of columns in the Query Design window, can I ignore than and just enter what I need in the SQL view?

View 6 Replies View Related

Report - Columns Within Fields?

Nov 21, 2006

I'm new to access, so any help is greatly apprciated. Is there a way to have one field within a report show up as 2 columns? Thanks much!

View 2 Replies View Related

Automatically Populating Fields/columns

Dec 21, 2005

I have Two tables one table has a Master list of products (ProductMaster) with a Unique product code (ProductMaster.UQ_ID).
The second Table has Order data. The Second table (OrderTable) is where I will enter the product code (UQ_ID) which is the unique Identifier which is also in the ProductMaster. As soon as I enter the Prodt code in the OrderTable I should have all the related fields filled in from the Product Master.

Columns in The ProductMaster = Product_ID, Product_Manucaturer, Product_Weight, Product_Color, Product_Size

Columns in The OrderTable = Product_ID, Product_Manucaturer, Product_Weight, Product_Color, Product_Size, Order_Date, Ordered_By

The columns marked in red are the ones that will have to be automatically fetched from ProductMaster

The data in the second table should be populated from the ProductMaster as soon as I enter the Product_Code. The rest of the details Can be filled manually filled in.

Is it possible to do this with Access. I have tried different expressions in the Fields without much use. The Documentation from Microsoft is very weak. If someone knows a solution or where the documentation is, please help.

Thanks

View 2 Replies View Related

Remove Duplicates From Four Different Fields/columns

Jul 31, 2007

Hi everyone,

I am working on a database to manage newsletter subscriptions. Each subscriber record has the option of having up to four email addresses registered to his/her name.

Is there a way to check for duplicate email addresses in the entire database? It would have to compare all values in all four fields of all records.

Any ideas on how to implement such a thing? I'm clueless...

Thanks!

View 2 Replies View Related

How Can I Compare Fields With 2 Bound Columns

Aug 9, 2005

Hello..

In one of my tables I have a field with the following characteristics:

Listbox
row source: SELECT Category.CategoryID, Category.Category FROM Category ORDER BY Category.CategoryID;
row source type: table/query
bound column:2
column count: 2

This gives the user the opportunity to see the category as well as the categoryID when choosing, however once selected only the CategoryID (which is a number) is visible.

I would like to put the same option on one of my forms, but Im not succeeding at this. How can I do this? Is this possible?

This leads me to my next question: If I want to load the information from the form and compare it in VBA with the one from the table, is it seen as a number or a string?
I hope it is clear..
Any thoughts on how to deal with this??
Thank u..
Stacey

View 8 Replies View Related

Report With Unique Fields As Columns

Apr 24, 2014

I have a large query that has information from accounts sorted by date, account repeat but they are always associated with a different date. I'd like to create a report where each date has it's own column with an associated field displayed as the information in the column. However, as data is added to the table I'd prefer to do it without having to make a query to filter each date each time information is added.

The information is added in bulk with all the same dates, so ALL accounts (excluding newly opened accounts that may have no information with a certain date) should have information for each date - there will not be single accounts with their own date. For example: An account numbered 12345 with data of 57% on 1/2/13, 63% on 6/2/13, and 89% on 12/2/13. I'd like each of the dates to have their own column, with the account numbers as the row and the percent data to show under the date they are associated with. how to manage this in a report, or if it is possible.

View 1 Replies View Related

Table With Three Fields - Rows To Columns

Jan 28, 2012

Rows to columns;

I have a table with three fields

ID,Desc,Code
1,aaa,code1
2,bbb,code2
3. aaa,code3
4, bbb,code4

I need a query creating these two columns:

Desc,Code
aaa,code1;code3
bbb,code2;code4

how can I do this?

View 1 Replies View Related

Queries :: Matching Fields From Multiple Columns

Jun 26, 2013

I have a series of numbers in 30 columns. I want to identify where either of two numbers appear in the same record regardless of which of the 30 columns they are in.

OTHCPT2OTHCPT3OTHCPT4OTHCPT5OTHCPT6OTHCPT7
00300C1778C1820J0690 J2250 J2270
00300C1778C1820J0690 J2250 J2270
00300C1778C1820J0690 #NULL!#NULL!
2318095978C176788307J0131 J2270

For instance if 23180 and J2270 are in the same record I want to identify them for all of the records.

View 7 Replies View Related

Tables :: Save List Box Columns To Table Fields

Mar 31, 2015

What is the correct way to save the values in a listbox column to the fields of a table? I can use rec("field1") = Me.list16.ItemData(Varitem)and that records the bound column to field 1 but how can I save the unbound columns to other fields in the table?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved