Queries :: Query / Count And Display Based On Date?
Dec 18, 2014
I am trying to run query on a months worth of dates, have it count based on each day and then display the date and the number?
Table:
field1 - field2 - field 3 - Date
I can run a query one day at a time but would like to run it for the month and get this
12/01/2014 - 15
12/02/2014 - 32
12/03/2014 - 0
12/04/2014 - 12
View Replies
ADVERTISEMENT
Sep 8, 2014
In the fields of the table, among others, there is a date field which represents the starting date of the flat availability. I'd like to create a query which displays the available nights per flat for each month in the current year. For example, Flat1 is available from 11.08.2014, then I'd like to see in the query result 20 nights for August and 30 for September, 31 for October and so on.I created a query which displays only the dates for the current year. Then I joined this query with the Flats table, the join condition is query.date >= flat.valid_from_date and displayed 1 in each row in the result as night. This way, I have the available flats for each day with 1 as available night. Then I tried to summarize the number of nights by month and flat.
View 5 Replies
View Related
Jul 7, 2015
I have a query which is displaying a date/time field a record was input. in my query I'd like to only display the records where the date/time based on what today is i.e. Monday it will display <Friday or yesterday for Tue to Fri.
View 7 Replies
View Related
Aug 13, 2015
How do you grab a custom Fiscal Year's values based on the system clock's date?
I am building a query where I want to see the number of closed cases based on the current custom fiscal year with the system clocks date. The report that it feeds only cares about the current FY.
I need the System Clock's FY value in this query
Code:
SELECT shortname AS Station, NZ(TotalCount.TotalCases,0) AS [Cases Complete]
FROM StationList LEFT JOIN (SELECT station, count([Open Issues].ID) AS TotalCases FROM [Open Issues] WHERE [Status]="Closed" GROUP BY Station) AS TotalCount ON StationList.shortname =TotalCount.station;
Within the Query Open Issues I have the FY broken up
Code:
fiscalYear: IIf(Month([Issues].[Opened Date])>=10,"FY" & Year(DateAdd("yyyy",1,[Issues].[Opened Date])),"FY" & Year([Issues].[Opened Date]))
View 4 Replies
View Related
Apr 2, 2013
I run a physical therapy office and patients come in for treatment either 3, 4 or 5 times per week. My database is used to track these frequencies (among other things).
I have 3 queries which count how many patients come in 5, 4 and 3 times/week.
In my main table I have fields called "how many 5's", "how many 4's" and "how many 3's".
I have tried to design an update query which will update those fileds in my main table to reflect the counts in the 3 queries mentioned above.
(I'm not using SQL view, I'm using the query design view)
In the "update to:" row, I use the Build function and locate the count I'm looking for.
Problem: when I run the query I get the error: Operation must use an updateable query.
View 3 Replies
View Related
Nov 27, 2013
I have a form with cascading combo boxes pulling from a table. They work perfectly, no worries. My problem now is if I do not enter information in every combo box (i.e. only two out of four combo boxes), how can I still run the query and get the appropriate information?
For example (these are my combo box titles in order):
Product
Type
Customer
Contract #
I don't want to necessarily look by Contract # all the time, but sometimes just by the general Product and Type to get a larger view. How do I set up expressions/criteria in my query to accurately produce that information? Right now it just produces a blank query table if I don't fill out all the boxes.
I've tried a couple of expressions with "isnull" criteria, but I must be doing it incorrectly.
View 2 Replies
View Related
Aug 14, 2013
I want to count the number of tasks by department by week. I need the time so my date the task was added is formated as a date/time.
I created a query and added the department (twice so that I can group and count), and transaction date. I clicked on totals and added the count function under the department. I added this criteria to the task date: between [start date] and [end date].
Problem is that it's grouping by day and each one is different because all times are different. How do I group these by day and not time?
View 7 Replies
View Related
Sep 16, 2013
I am trying to build a report that shows the total count for multiple queries.
For instance I have a field in my table that can be either A, B, or C.
I have 3 queries built, 1 to show me the information for A's, 1 for B's, and 1 for C's.
I would like a report that shows me ONLY the total number of each category. such as:
A= 38
B= 72
C=12
Thus far I have only been able to create one that shows me all of the information from the queries.
View 4 Replies
View Related
May 16, 2013
Within a query, I'd like to reference another query field based on a date specified as a parameter.
In my query, there are fields for each month: [January],[February], etc.
I have a field titled [Current Month], based on the parameter [As Of Date]. So if when running the query, the parameter pops up and I type 5/6/2013, it knows that the month is May. I know how to return May in the current month field (format([As Of Date],"MMMM"). But how to I return the value that is in the May column?
View 3 Replies
View Related
Jul 26, 2015
I am currently working on a project to develop an access database to manage a roster of calls to clients on a daily basis based on two general criteria:
1. Pre-determined days selected by the client. (e.g. Call Mon, Wed, Fri only. This can change as client requirements change.)
2. Ad-hoc changes based on the client’s circumstances. (e.g. No call from 27/7/2015 to 29/7/ 2015)
I have managed to successfully deal with the second of these with the following expression in a query:
CallToday?: IIf((Date()>=[NoCallFrom] And Date()<=[NoCallTo]),"No","Yes")
However dealing with the first is a little more difficult to work out. I have tried a multivalue lookup field with multiple days selectable, but constructing an IIF query to deal with these multiple values is proving quite a challenge.
I am thinking of using a table with days of the week and a junction table to allow the multi-selection, but I may need constructing the relationships and the query here.
View 8 Replies
View Related
Oct 7, 2014
Is there a way to make a form that will display all records based on a single date, at the same time, in the same format each and every time?I have a table which has the following fields:
ID (Autonumber, PK)
ServiceDate
RunningNumber
BonnetNumber
Deallocate (yes/no)
Now, I would quite like to keep the form in a style similar to all the others I have, not least as I have to cater for users of all age and abilities, so keeping things as simple. I have attached an image - each row to represent a record basically, I would like the form to open and show the same layout on each day (I would place the textboxes etc in route groups); a null value would not be allowed for at least one field in each record, I could force the records to populate the form in the same way each day?
View 10 Replies
View Related
Jan 19, 2015
Code:
' count records in query
Dim rs As DAO.Recordset
Dim db As Database
Dim strSQL As String
Dim beginDatum As String
Dim eindDatum As String
Set db = CurrentDb
[code]....
View 4 Replies
View Related
Jun 30, 2013
I have set up a form and only want to display the date and time that will appear automatically based on when the record was created. I definitely don't know how to do this.
The format that I'm looking for is: 07/24/13 11:45:44pm
From what I can see I would need two separate fields to accomplish this. I would prefer to only use one if possible. I would like to execute the value within the new record as it is entered. That date and time from that point should never change.
I will want to use the date and time in the future for quality control.
View 3 Replies
View Related
Jan 19, 2015
I am having difficulty getting a second textbox to display the correct total of hours based on a date entered into a first textbox.
Setup:
Table Name: TestTable1
Fields: 'RequestDate' & 'Hours'
Form: 'Form1'
2 Textboxes Unbound: Named 'Date' & 'Total'
What I am trying to accomplish:
Based upon a date entered into the "Date" textbox I want the "Total" textbox to display the total hours associated with that date.
What I have tried:
I have tried using, in the control source property of the "Total" textbox, many iterations of both Sum(IIF & DSum(
I am currently using the following:
=DSum("[Hours]","TestTable1","[RequestDate]='Forms! Form1!'Me.Date'")
I have tried this without the Forms designation; without the "Me" designation; Etc.
Some attempts return the Error or Name error while other efforts return a blank textbox...
View 4 Replies
View Related
May 17, 2013
I have a form that request information from the user (StartDate, StartTime, EndDate and EndTime) the problem is that it's not working. The only way I can get any data to show is when I remove the StartTime and EndTime. Only then will it pull the items from the StartDate and EndDate.
Here is what I have as my criteria: Between [Forms]![OpPROD_ALL]![StartTime] And [Forms]![ OpPROD_ALL]![EndTime] And Between [Forms]![ OpPROD_ALL]![StartDate] And [Forms]![ OpPROD_ALL]![EndDate]
The users will be able to request a report based on a start and end date along with a start time and end time.
Side note: this is to pull date for 3rd shift (Example) 4/14/2013 10:00PM - 4/15/2013 10PM
View 1 Replies
View Related
Aug 27, 2013
want my query to count only records that are not duplicated based on a set of criteria.I have a table with customer IDs and Call dates and the employee ID. I want a count of the call dates for each customer ID for each employee. However I only want to count as one occurrence if multiple calls happened on the same day. For example
Cust_ID Call_Dt
12315 8/1/2013
12315 8/1/2013
12315 8/1/2013
14253 9/1/2013
Customer ID 12315 would only count a 1 call entry instead of 3 for the date of 8/1/2013
View 3 Replies
View Related
Jun 12, 2013
I did a calculation in a query that gives me how many minutes/hours it took to process records. Now what I need to do is show how many records took only 0-2 hours to process. 2-4 hours to process. 4-6 hours to process etc.
View 2 Replies
View Related
Mar 26, 2014
We have a field that we track paperwork with that is 9 characters. The first 4 characters are a 'julian date', the 5th character is a dash and the last 4 characters are sequential.
Example:
For today, we would use 4085-0001, 4085-0002, 4085-0003, etc.
For yesterday: 4084-0001, 4084-0002, etc.
I have a query set up that will pull records with a julian date of today-1 and today-7 that works. So a result I may get:
4084-0001
4084-0002
4081-0000
4078-0000
4078-0001
4078-0002
I tried formatting the source field with Left -4, but it only shows the first four characters in the result:
4084
4084
4081
4078
4078
4078
How can I count the number of records each day based on only the first four characters? Example:
4084 = 2
4081 = 1
4078 = 3
View 6 Replies
View Related
May 31, 2014
I have 4 fields I'm trying to combine, but I need to add spaces between field 1 and the rest of them. The total character count needs to be 22 including the spaces.
Example:
Field 1: THE
Field 2: 1234
Field 3: BOAT
Field 4: 0001
End Result: THE 1234BOAT0001
Need to add 7 spaces to equal 22 characters.
Fields 1, 2, and 3 can vary in number of characters.
View 6 Replies
View Related
Apr 13, 2006
I have a table tblBookings.
In this table it has a bookingID, CustomerID and some other none relevant details.
The CustomerID comes from table tblCustomer. i.e a customerID must exist in the customer table to be allowed in the bookings table tblBookings
A customer can exist in tblCustomer without existing in the booking table.
I am trying to write a query that will list each and every customer ID in the tblCustomer and count the number of bookings that that customer has (even if it is zero).
I have a query that will count the bookings if they exist in the booking table and display the number of times that a customer appears in the bookings table.
SELECT tblBookings.CustomerID, Count(tblBookings.CustomerID) AS NoOfBookings
FROM tblBookings
GROUP BY tblBookings.CustomerID;
How do I create a query that will do this but list all customers even if they don't exist in the bookings table (but obviously occur in the customers table)
I am trying to create a similar query where all bookings per hotel are listed even if no bookings are made for that hotel. I am guessing the answer is the same as above.
The Ritz. Bookings 0
The Hilton. Bookings 3
The Carlton. Bookings 0
The Lowry. Bookings 2
For every hotel.
That kind of thing.
If you need more information please shout.
View 3 Replies
View Related
Nov 9, 2014
I have a database that contains details of payments returned to a bank account without sufficient information to identify who the money belongs to.
The DB is used by a team of people to retrieve details of an individual entry and when they have figured out who the money should be sent to they can mark that the payment has been "located". We can only send the refund at certain times of the month, so there is another activity "applied" where we have entered details on internal systems for the refund to be processed. Finally, once a month we physically transfer the money out of the bank account and add a "completed" date to all entries that were "applied" before that date.
My manager would like to be able to look back at a certain date to see what the balance was so he can make charts and whatever else in Excel. The balance will be all payments that were not marked as "completed" on that particular date.
I'm having trouble making a query that will give him the balance for each day in the past.
The important tables/fields here are
TBL_MAIN - dateReceived (date) and amountRefunded (currency)
TLK_LOCATED - appliedDate (date/Time) completedDate (date/Time)
TBL_DATES - activityDate - just a list of dates, which I use for a similar query of the amount we located/applied each day
So I'm looking for a query that will list all dates in tbl_dates against the sum of amountReceived up until that date, with the sum of amountReceived where completedDate is less than the date listed subtracted.
View 4 Replies
View Related
May 7, 2013
I am using the following expression to calculate a completion date for a project which is based on the due date. My problem that I am running into is when I get to a project that is due on a Tuesday, it returns a date for Sunday when it should be Friday.
IIf(Weekday([Due Date])=2,DateAdd("d",-4,[Due Date]),DateAdd("d",-2,[Due Date]))
View 3 Replies
View Related
Jul 28, 2006
I wish to display a message box, only if a query returns results. I would have it on the OlLoad portion of my form. The problem I am having is doing the sql in the vba portion of the code...it would look something like this:
sql = "select * from table"
if results of sql are not blank, then
msgbox("hello")
end if
Can someone help me please?
View 14 Replies
View Related
Mar 15, 2013
I would like to create a query that displays a date like this "20130315". Can this be done?
View 4 Replies
View Related
May 21, 2015
I would like to make a query that count simultaneous connection.
Here is my tables
Users (ID_User, Name)
Date_logon (Id_on, Date_logon, time_logon, Num_user#)
Date_logoff (Id_logoff, Date_logoff, time_logoff, Num_user#)
Here is a part of a query that display users date and time of log on and log off.
Users Date_logon Time_logon Date_logoff Time_logoff
Utilisateur1 13/05/2015 17:38:42 13/05/2015 18:52:15
Utilisateur2 13/05/2015 17:12:21 13/05/2015 17:30:24
Utilisateur3 13/05/2015 16:59:08 13/05/2015 17:16:06
Utilisateur4 13/05/2015 16:54:14 13/05/2015 18:32:13
Then I put that result in a pivot table in Excel. In line we have time logon by date and in column we have time logoff by date.
Here is the issue : In Excel for the 4 lines above, it counts 2 logon at 4PM and 2 logon at 5PM. We should have 4.
View 14 Replies
View Related
Nov 4, 2014
Doing a school project and need to add a count function to a sub form that is based on my query. The count function just needs to be displayed on the bottom of the sub form showing how many records are in the sub form.
When I do this, the function works all good.
When I add the function to a header or footer, so that it doesn't show a column and repeat itself each time.
View 2 Replies
View Related