General :: Aggregation Over 5 Minute Periods
May 6, 2014
I have several pieces of equipment that register data every minute, is there a way to do like a 5 minute average
i.e., 00:00 - 00:04, 05:00 - 09:00
NOT 00:00- 05:00, 01:00- 06:00 and so on.
View Replies
ADVERTISEMENT
Jan 10, 2014
I am trying to use criteria for Product column (i.e keep only product A) Total for Sales column to aggregate the values and it seems that is cannot be done simultaneously.
Product Sales
A 34
A 45
B 21
A 11
B 23
Eventually i want to get a table like below
Product Sales
A 90
I get the following warning : you tried to execute a query that does not include the specifies expression as part of an aggregate function.Why is this happening. I don't want to create 2 different queries to achieve it. Is there a way to do it i the same query?
View 8 Replies
View Related
Apr 16, 2013
I have the table "tblProductionForecast" with the following fields:
ProductionForecastProductId
ProductionForecastMonth
ProductionForecastQuantity
I want to show this in a report, similar to an spreadsheet, with:
ProductionForecastProductId = Rows
ProductionForecastMonth = Columns
ProductionForecastQuantity = Data
I thought of using a crosstab query like this:
Code:
TRANSFORM avg(tblProductionForecast.[ProductionForecastQuantity]) AS AvgOfProductionForecastQuantity
SELECT tblProductionForecast.[ProductionForecastProductId]
FROM tblProductionForecast
GROUP BY tblProductionForecast.[ProductionForecastProductId]
PIVOT tblProductionForecast.[ProductionForecastMonth];
but I don't want the average of ProductionForecastQuantity. I want the actual value!
Is a crosstab query the wrong method to use?
If no, how do I show the actual value of ProductionForecastQuantity
If yes, how should I create the report?
View 5 Replies
View Related
Aug 1, 2006
Hi
I want reduce one minute from my date field. My date field looks like this: 17.3.2006 3:57:00 and I want it to look like this:17.3.2006 3:55:00. I have tried to make it like this: DATEADD( minutes, -2, [StartTime]) AS NewStart. StartTime is date field. But this doesent work. Could somebody tell me how to reduce one minute from date field??
View 2 Replies
View Related
Jun 22, 2014
i have a problem i have field contains (minutes as number) like 5750 i want to convert thes minutes to short time hh :nn to be 95:50
View 3 Replies
View Related
Aug 19, 2004
I am using a Access database with a frontend/backend design. I want to keep a table in the BE updated with the current list of users inside of the frontend. To do this I thought that I would just have the front end update a time field saying that that user is still inside of the FE. My question is two-fold - firstly, how can I run a function every minute or so to update this table.
Secondly - is there a better way to do this?
Thanks in advance for any help you can offer.
View 3 Replies
View Related
May 19, 2015
I have to write a code in a form so that if nobody is doing any activity for 5 minutes then after 5 minutes automatically press Close button named BtnClose in that form.
View 5 Replies
View Related
Dec 20, 2013
I am trying to figure out how to take a table of timestamps and activity duration and break it into intervals, where it groups the duration into the time spent in each 15 minute interval. I have included a sample of the data and output. Is there any way to pull this in Access (or SQL)?
Raw Data
EmployeeActivityTimeStampStartTimeStampEndTotalDuration
Doe,JohnSomeActivity12/16/13 9:06:02 AM12/16/13 9:57:14 AM0:51:12
Smith,JaneOtherActivity12/16/13 9:22:15 AM12/16/13 10:06:55 AM0:44:40
Query to break out the total duration time in to the 15 minute interval it fell into
EmployeeActivityIntervalIntervalDuration
Doe,JohnSomeActivity12/16/13 9:00:00 AM0:08:58
Doe,JohnSomeActivity12/16/13 9:15:00 AM0:15:00
Doe,JohnSomeActivity12/16/13 9:30:00 AM0:15:00
Doe,JohnSomeActivity12/16/13 9:45:00 AM0:12:14
Smith,JaneOtherActivity12/16/13 9:15:00 AM0:07:45
Smith,JaneOtherActivity12/16/13 9:30:00 AM0:15:00
Smith,JaneOtherActivity12/16/13 9:45:00 AM0:15:00
Smith,JaneOtherActivity12/16/13 10:00:00 AM0:06:55
View 2 Replies
View Related
Nov 1, 2007
HI All
I have a question that I just cant seem to get my head around....so I thought I'd pick your brains!
I have a table that has DriverID, Date, Work, Sleep, Rest. As you can imagine, this records their hours of work, sleep & rest.
Now with new fatigue management laws in Oz, we need to find out if they're working for more than 168 hours in a 14 day period.....
My thoughts are, create a query that runs through every date of the year, then counts forward 2 weeks, sums the WORK hours and only displays anything over 168 hours??? Is this correct? Would that not simply die ? Considering we have about 30 drivers to run through?
View 7 Replies
View Related
Jan 25, 2006
I have read more post than i care to think about but I can't stil get my head round the following problem.
I have created a database (with this forums help) but I am stuck on the following query/form/vba etc....
Our staff holidays run from 01/05/05 until 30/04/06 and i have a query that calculates what holiday entitlement staff are due from 01/05/05 on a daily basis up to 23 days worth of hols ending on 30/04/06, but I can't work out how to set next years holiday period 01/05/06 - 30/04/07 without changing the form manually, is there a way for it to auto update??
View 2 Replies
View Related
Jul 31, 2005
I am tyrying to get my query to analyse the last three months of data but typing the following in the criteria section under Potting Date
Date()-90
An error is occuring.
Can anybody assist with this problem, I think I am writing the wrong thing
Regards Karen
View 6 Replies
View Related
Oct 29, 2006
Hi all!
I want to add a function to a form that filters records from a specific date period.
Each record has a field containing the date the record was added.
Example: I want to show the records added between 15.09.2006 and 10.10.2006.
Furthermore, the “from” and “to date” must be defined in textboxes, and the filter initiated with a button.
I need this functionality on a continuous form and in a report. How do I achieve this?
View 14 Replies
View Related
Jun 6, 2006
We have a db of salmon survey data where catch data is recorded by date, site, etc.
Historically, we have used ‘sampling periods’ to group our results into blocks of time that can be compared from year to year, and within year.
Now, having frequented this forum I’ve read that we shouldn’t store information in tables that can be calculated from fields and I want to try to follow that advice in this instance but am having trouble working this out.
Here’s how we define a sampling period.
1.The start date of the first sampling period in a sampling year is the last Monday in the most recent November.
2.Each sampling period is 14 days long.
What I want to do is have a query use the date of a set to calculate what sampling period the set belongs to. I have an idea that I could use a datediff function to calculate this if I can figure out the ‘last Monday in the previous November’ part. I’ve searched this forum and googled but am having trouble finding anything that I can adapt to this as a query expression.
Anyone care to help a fish bio out? Much obliged :)
View 5 Replies
View Related
Oct 18, 2006
I am new to Access and would be very grateful for some adivce on setting up a query.
The data in the table below comes from a photon counter. Both fields are numbers although TIME actually represents seconds.
I need to be able to group the DATA field by arbitrary TIME periods. e.g. to divide the table up into bins of, say, 8.7 seconds length, showing the total accumulated in the DATA field for each successive period of 8.7 seconds.
The tables are about 300,000 records long.
Any help would be much appreciated.
Thanks,
TIME - DATA
285748175.864557 - 100
285748175.874556 - 100
285748175.884556 - 0
285748175.894557 - 100
285748175.904557 - 0
285748175.914556 - 200
285748175.924556 - 300
285748175.934556 - 0
View 7 Replies
View Related
Apr 1, 2013
I have some issues with summarizing in a query. My intention is to summarize income and expenses over periods
This is how it should look like.
Periods_____Total income___Total expenses
01-2013_____234__________435
02-2013_____533__________132
03-2013_____345__________853
etc
I made the following query to get the result I wanted.
Unfortunately, the result seems to be multiplied instead of summarized.
View 3 Replies
View Related
Jan 23, 2014
If my fiscal year ends 12/31 but the pay period doesn't end until 1/10, how do I get a query to tell me there are 25.3 pay periods remaining (counting from the last pay period 1/11)?
View 3 Replies
View Related
Sep 10, 2007
Hello,
I'm having a hard time trying to figure out how I should go about designing the table structure for the hours tracking for the database I'm working on. Basically, I have a table with projects (tblProj) that I need to track the number of labor hours worked per month. The problem lies in the fact that each project could have varying time periods, anywhere from less than a year to more than a year and can start and end at any time of the year.
I was thinking of creating a second table (tblProjHours) to store the hours for the project but I'm not sure what the most efficient way of doing this would be. My idea was to create a table as follows:
tblProjHours
ProjHoursID (pk)
ProjID (fk)
BeginDate
EndDate
Month1
Month2
Month3, etc....
I would create a large number of fields/columns, something like Month1 to Month36 just to make sure I have enough months to enter in the hours. This is of course inefficient since some projects would be way shorter than the maximum allowed months set by the table structure and there is always the possibility of surpassing the maximum allowed months based on the table structure. I was wondering if someone had any better ideas on how I should pursue the design. Thanks in advance!
TheMach
View 2 Replies
View Related
Jul 27, 2005
I'm having trouble finding an entry anywhere about this, although I'm sure I'm not the first person to come across it...
When I am typing my entry into a combobox it begins to autosearch, highlighting the part of the entry that it finds that matches the beginning that I typed in (as a normal combobox does in access).
However, when the entry it finds has multiple periods in it (i.e.: S.T.A.R) it stops searching and does not highlight the remainder of the entry it moved to. I'm not sure that searching is the correct term, which may be why I can't find any information on this, but is there a way to correct this problem?
View 2 Replies
View Related
Dec 14, 2004
I have a MS Access database that tracks when packages are received, returned, etc from different agencies. I need to create a query or report that shows how many packages were received, returned, etc PER MONTH, PER AGENCY. I was able to create a query that listed all the "Date Pkg Rec'd" dates for October (Between #10/1/2004# and #10/31/2004#), but I don't want a listing of all of the dates, rather a total of the records within those timeframes PER AGENCY. For example, APHIS 10, FAS 3, etc.
The other problem I have is I need this done across many columns without excluding those records without an October date (for example) in them. For example, I could have a "Date Pkg Rec'd" date in October, but not an October date listed in the "Date Pkg Returned" column.
Basically, I need the simpliest way to generate monthly "record totals" for several fields.
Any help would be appreciated.
Thanks.
View 1 Replies
View Related
Nov 21, 2013
I have a grouped query that returns a list of all periods qryPeriod
Code:
SELECT [tblMaster].Year, [tblMaster].Week, ([Year] & " - " & Right(0 & [Week],2)) AS Period
FROM [tblMaster]
GROUP BY [tblMaster].Year, [tblMaster].Week, ([Year] & " - " & Right(0 & [Week],2));
Year | Week | Period
2013 | 48 | 2013 - 48
2013 | 49 | 2013 - 49
2013 | 50 | 2013 - 50
2013 | 51 | 2013 - 51
2013 | 52 | 2013 - 52
2014 | 1 | 2014 - 01
2014 | 2 | 2014 - 02
2014 | 3 | 2014 - 03
2014 | 4 | 2014 - 04
[code]...
these are then used as the start of a between lookup against [tblMaster] along with the last record in the qryPeriod (2014 - 04)...I will need 4 queries so If someone can sort out last period - 8 I can probably do the others.would DLookUp do this say return the last 4 values, Last 6 Values and Last 8 Values
View 6 Replies
View Related
Mar 25, 2014
Suppose that you want to make a formula which will calculate time periods based on a given tariff. To be more precise.
Suppose you can "get in" somewhere, entrance is $2.
You are free to stay there, without additional charge, for 5 days.
Then, for the next 5 days, the charge is $1 per day
The next 7 days, the charge is $1.5 per day
Thereafter, $3 per day.
In this scenario, we can make a query, we use datediff function to see the number of days between "gate in" and "gate out".
The problem is that the tariff is not very simple and the query gets to big and difficult to control with lot's of "iif" and may be I need to make more than 4 queries and union select and so on.
I tried to find in the docmd if there is any suitable function that I could use.
View 7 Replies
View Related
Nov 19, 2013
I developed a finance tracker database for tracking project revenues and costs (forecast and actual amounts). I have a form where we enter a new Work Order in the DB. This Work Order form has a continous subform where we create all the billing periods needed for the life of the Work Order. Once the billing periods are created (opened) we can then add our revenue and cost forecasts for each period. We have a Billing Period lookup table that has our billing periods with their respective start and end dates (which usually begin around the last week of a month and end about 3 weeks into the next month).
For the purpose of this question, lets say we only enter the required WO_Number and WBS_Code (Composite key) and the Work Order Start_Date and End_Date. I want to click a button to runs some code to automatically create all the billing periods for which their start and end dates fall into the Work Order start and end dates.
For example, say a Work Order starts on 5/1/2013 and ends on 7/31/2013
The billing period dates in the Billing Periods lookup table are as follows:
May-13 ---> 4/22/2013 - 5/19/2013
Jun-13 ---> 5/20/2013 - 6/23/2013
Jul-13 ---> 6/24/2013 - 7/21/2013
Aug-13 ---> 7/22/2013 - 8/18/2013
Then we would need the following billing periods created in the Work Order subform:
May-13
Jun-13
Jul-13
Aug-13
I don't even know where to start on this. Is it possible to automate this process with the setup I have? If so, how would I structure the VBA code/logic to use the billing period lookup table and create entries in the subform for all the billing periods that fall into the duration of the Work Order.
The attached DB is a stripped down version with only the tables and forms needed for this problem.
View 2 Replies
View Related
Jul 18, 2006
I am desperate for some help. I have been asked to establish a database for our office use and I have done the best that I can without any 'education' or 'instruction' on access, but now I am just absolutely stuck.
I have made forms, and tables, and a switchboard but I think I am having major 'relationship' issues and thats why my forms are not 'cooperating' with me.
My questions I think are so specific to the database that I just created, or tried to anyway, that I really can't ask a question in 'general'. I could send someone my database and let ya look at it and then perhaps you could assist, if anyone is interested.
Thank you so much, like I said I am very much inexperienced in this and am desperate.
View 7 Replies
View Related
Sep 25, 2005
I need to be pointed in the right direction if you don't mind. I understand underlying database structures pretty well, but I am not sure how to create a form in Access so the user can enter new data. I am tring to create a form based off of the classes table first and then go from there. I was hoping to be able to allow the end user the ability to enter all information from one form.
I have attached the relationship structure that I have setup but I am not sure where I need to go next. Should I create queries and then insert the queries to my form?
Thanks for help
Steve
View 4 Replies
View Related
Oct 24, 2006
I got an MS Access 2003 db which I think has an general option disbabled or so dnno, here's the case:
When I create a query, and choose to close the query (just be clicking the "X" button at the top), Access doesn't ask me to save the query or not.. it directly displays the box to fill in the name of the query
When I execute an action query, Access just executes it when I click "!" button, without asking me if I want to "deleting, updating, adding xx records"
I've been searching ages to find an option to enable but I can't seem to find anything
Can anybody help me?
View 3 Replies
View Related
Dec 28, 2007
im trying to upload a document with screen shots on the forums. Its 336kb, how do i make that smaller so ican upload since the limit is 100kb, if i take a screenshot and put them into 1 docuemnt per screen shot it still 115kb.
any help
View 1 Replies
View Related