I'm having a hard time getting the output below from a query and was wondering if anyone would be able to reproduce this. Basically I'm trying to retrieve products that have more than 5 sales on a specific date and the retailers they sold at. I have the following simplified table.
I have a table in my database with a field called description. Imagine if one of my discriptions is "I learn a lot in access world forums". I need a query that if I look only for a word "access" will retrieve this discription. Is this possible to be done in access?
Hi All. In a query I grouped DATE by month Date:Format([Date],"yyyy mmm") to calculate visits in each month. My problem is: How to create dialog where user can enter date based only on YEAR and MONTH and enter in this dialog start_date and end_date? Thanks.
I have a query that creates counts of fields based on the data in other fields, basically it tells me that in a table there are two entries with value ABC????? and three of DEF????? , the query works perfectly.
When I create a form to display this data and base the form on the Query I keep getting a message box asking for the ID (key field) from the base table.
If I type * in the box (to denote all values) and press enter I get the results expected.
I'm building a health data system that stores data from health tests as follows: [test01], [test02], [test03],.........[test25], etc etc. Each of these tests comprised of a "Pass"/"Fail" value.
Now, i'm building my queries for a feedback report to hand over to the client that is based solely on the 1 single client record. In other words the queries are designed to return only 1 single data record to be placed in the client report where the based on the corresponding [TestID].
So within this 1 data record i want a query to count the number of times "Pass" appears in the test fields?
As there are some 40-50 [test##] fields in this one test battery i don'y particularly want to go back and code an IIf statement for each component if i can help it.
Basically I want to create a query that shows a table like so: Wages: Contractor [Contractors.Contractor] Jobs_done [counts the number of rows from Job that has the Contractor_ID equal to the Contractor_ID specific to Contractor (above)]
Eg.
Job: Contractor_ID 1 2 3 2 1 4
Contractors: Contractor_ID Contractor 1 Bob 2 Bill 3 Jim 4 Jill
Wages: Contractor Jobs_done Bob 2 Bill 2 Jim 1 Jill 1
I have been struggling over this the past few days and get no where. I am trying to count the number of times Yes appears in a few fields. This is what I have right now in design view:
Field1YesCount: Count(IIF([Field1] = True,1,0))
Field2YesCount: Count(IIF([Field2] = True,1,0))
Field3YesCount: Count(IIF([Field3] = True,1,0))
This doesnt seem to work, could someone please help.
I have been struggling over this the past few days and get no where. I am trying to count the number of times Yes appears in a few fields. This is what I have right now in design view:
Field1YesCount: Count(IIF([Field1] = True,1,0))
Field2YesCount: Count(IIF([Field2] = True,1,0))
Field3YesCount: Count(IIF([Field3] = True,1,0))
This doesnt seem to work, could someone please help.
Hi there. Im trying to work out how I can count the dates in my database per month. What ive done is created an unbound box with an sql statement
SELECT Count([tbl Main].[Date of Call]) AS [CountOfDate of Call] FROM [tbl Main] HAVING (((Count([tbl Main].[Date of Call])) Between #4/1/2006# And #4/6/2006#));
When I select the totals button to count the records 0 are pulled out.
Does anyone know if im doing something wrong here. As always im sure its quite simple..
Boss-Man has a db (humongous) that (along with a zillion other things) tracks which specific tasks have been completed, who has done it and when did they do it. All tasks will eventually be completed by all employees.
He's got a query that returns all of the dates on which each task has been completed, using each TASK name as a field.
The short version below shows the TASK1 was completed on 1/1/07, 2/7/06 and 2/17/07, TASK2 was completed on 01/05/07,by 2 people on 2/15/07 and again on 02/28/07 and so on.
Looks to me like you'd first have to identify the possible WeekEnding dates and then try to total across all the fields, but I've not got a clue how you'd do that.
Is there an easy way to "query the query", work with Week Ending on Saturday, and get the info he's looking for?
I’ve attached a zipped example of the problem I am having with customised navigation buttons.
In my main database the form “subfrmPersonsContact” works perfectly. I have exported it to a new database and now the customised record count fields do not work at all – they are in fact blank even though the navigation buttons do still work.
The code running the form and the record count fields is listed below – I have no idea why it’s not working.
Any help would be greatly appreciated.
Cheers,
Rusty :D
Private Sub Form_Current() On Error GoTo err_Form_Current
Dim rs As Recordset Dim Count As Integer, Position As Integer
Set rs = Me.RecordsetClone rs.MoveLast rs.MoveFirst
Position = Me.CurrentRecord Me!txtRecPos = Position
If Position = 1 Then Me!gotoPrevious.Enabled = False Me!gotoFirst.Enabled = False Else Me!gotoPrevious.Enabled = True Me!gotoFirst.Enabled = True End If
If Position = Count Then Me!gotoNext.Enabled = False Me!gotoLast.Enabled = False Me!txtRecCnt = "of " & Position Else Me!gotoNext.Enabled = True Me!gotoLast.Enabled = True Me!txtRecCnt = "of " & Count End If
rs.Close
exit_Form_Current: Exit Sub
err_Form_Current: If Err.Number = 3021 Then Resume Next Else Resume exit_Form_Current End If End Sub
Is it possible to have a count of all records matching a certain criteria displayed on the form?
I have to schedule customers for certain dates but never know how many have been scheduled by date while in the form. I am not sure how to reference the field from the table to be counted. I have several unbound boxes with:
=date()&" "&{XXXX}([SCHEDULE DATE]=date() =date()+1&" "&{XXXX}([SCHEDULE DATE]=date()+1 =date()+2&" "&{XXXX}([SCHEDULE DATE]=date()+2 etc.
not sure what to use for {XXXX}
As always, any help is appreciated.....
Someday I will contribute some answers instead of questions.....
If I have a Report, with three fields (all data-type Text) named 'Jan', 'Feb' and 'Mar', and I want to have a fourth field (Unbound) alongside them, providing a count of the number of fields out of these three fields that are populated.
I have a fairly simple query to weed out all the records in our database that are missing vital pieces of infomation :
Code: SELECT Contacts.Name, Contacts.Address1, Contacts.Address2, Contacts.Town, Contacts.County, Contacts.Country, Contacts.PostCode, Contacts.Telephone, Contacts.Code FROM Contacts WHERE (((Contacts.Address1) Is Null) OR ((Contacts.Address2) Is Null) OR ((Contacts.Town) Is Null) OR ((Contacts.County) Is Null));
Is there anyway to count how many fields are missing for each record ?
I have a form that records followup activities for protocols. The form allows the user to enter up to six f/u actions from a dropdown menu in six separate fields (called fu1_action, fu2_action, etc).
I am trying to write a query that retrieves only protocols that only have one f/u action selected as "telephone correspondence" and am having trouble. It seems I could write a function in VBA that would somehow loop through the 6 f/u action fields and give a value of 1 to those that have 'telephone correspondence' as a response, and then add them up to give a total of calls for that specific protocol, and then in a separate query only retrieve those that have a total number of calls = 1, but how to get started in writing this.
I have a terrible skill in this but I am doing my best to find ways. But I am running out of time in the development stage. I have the following form and table:
Tables: Eqpt EqptHistory
Forms: frmEqpt frmHistory
frmEqpt is the Mother form and frmHistory is the subform connected thru eqptID. Now what I want to do is count the records in the frmHistory and Locked the fields for editing. If it is new records, the fields will automatically unlock.
How do I do that because I can't find a way to count the fields with records and lock them.
a table which has several fields (ProjectID, Name, PM, Category, Date, Tester).
I am trying to find a way to count how many of the fields have been filled out and how many are null for a particular Project ID.
For example, ProjectID=27 has a Name and a PM but no more data so when I load the form I want the db to tell me 3 of the fields have been filled out for this project. This way I can calculate how many are empty (3 in this case)
Hi Have scoured the forum and have found people with a similar problem, but I just can't seem to get my head round this.
Basically I have a table with various fields, one of these fields is a sign off field where the user enters their name once the record has been reviewed.
I want to count all the records that do not have a name entered in this particular field thus are null/blank. I then want this figure to appear on a form thus representing the total number of records still to be reviewed.
I have tried doing this with various methods with no joy.
I am trying to create a clean database and code to generate a report.
I am trying to count the number of null fields in one of my queries:
However, because of this expression, I cannot carry other fields with it. So the end result looks like:
But I would really like it to spit out the following information:
Total Not Fixed: 241 Department: Sustaining Eng
is there a way to create an SQL query to simply add data: I have tried the following:
Code:
ALTER TABLE qrySustainingEngNotFixed2 ADD Dept TEXT(25) Insert Into qrySustainingEngNotFixed2 (Dept) Values (Sustaining Eng) SELECT TotalNotFixed, Dept FROM qrySustainingEngNotFixed2;
The above isn't working. Keep in mind that I want this is just for display purposes. I pondered making a custom table and then making a Union Query, but I'm trying to do this all in one SQL statement.
I would like to know, how do i reset the count of my auto number fields after testing? is it also possible to specify which number the auto number should start counting from?
Now, I want to know how many 1s are there in Rec3 the answer is obviously 2 but I want a field(F4, for e.g) that calculates F1+F2+F3 showing all their 1s 2s and 3s.
A solution I found was...... F4=IIf([F1],1,0)+IIf([F2],1,0)+IIf([F3],1,0)
But I have over 50 Fields that contain 1s and 2s and I can't count them all by using this formula as it will be tremendously long and access will reject it.
So I need another formula(or function) that will look up for the 1s across multiple fields and show the total count for each record in a new field.
Tried 'look up' function but achieved nothing ....
What I have: A table with multiple Date/Time columns. Here's an example:
What I would like: A month-by-month summary counting the number of entries in each of the three columns, like this:
I'm indifferent as to what happens with the months zeros across all three fields (whether they show up in the report with zeros or are omitted altogether).
Smaller Pieces: I am able to create such a summary for one column at a time:
Not what I'm looking for: I can not figure out how to create a query that does this for all three columns. My best attempt was a disaster:
I have attached the example file for your convenience: Database1.accdb
To clarify, my issue isn't the format of the date. I know about the Month(...) function. My question is regarding how to count this data and split it into a month-by-month summary (see the picture above in the "What I would like:" section)
the project I have comprises four seperate databases all linked but kept apart for logic and data reasons. I must have rapidly approaching 300k records across all of them. As a result I am trying to extract on a regular basis (monthly) the dimensions of each database. Specifically, I want to be able to produce for each database;The number of tables (I have two types data and reference, it would be nice to be able to split the result).The number of fields per table.The number of records per tableI am not really interested at this point about other database objects, such as queries or reports.