Date Periods In Query

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 Replies


ADVERTISEMENT

Filtering Specific Date Periods

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

Queries :: Grouped Query That Returns A List Of All Periods

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

Work Periods

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

Automate Holiday Periods

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

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 1 Replies View Related

Defining Sampling Periods Using A Calculated Field

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

Group Data Into Arbitrary Time Periods

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

Queries :: Summarize Income And Expenses Over Periods

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

Queries :: Number Of Pay Periods In A Fiscal Year

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

Table Stucture Help - Tracking Varying Time Periods

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

Combobox Won't Auto-search When Multiple Periods Are In Entry

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

Counting Records For Specified Time Periods In Multiple Rows

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

Modules & VBA :: Calculate Time Periods Based On A Given Tariff

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

Modules & VBA :: Automation - Create Billing Periods For Project Duration

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

Queries :: Date / Time Query - Return All Records Of Specified Date Or Date Range

Aug 19, 2015

I have a table that has entries recorded with date and time in one field, and I want to have a query that returns all records of a specified date or date range, regardless of the time in the field.

I have tried

Code:
Between [StartDate:] And [EndDate:]

And

Code:
Between [StartDate:] & "00:00" And [EndDate:] & "23:59"

Neither of which work ....

View 13 Replies View Related

Queries :: Date Query To Match Other Date Query?

Nov 3, 2014

running 3 queries together.

1 qry has a date parameter of start/end date(running before the 3 are together)

Have a field in 1 of the 3 queries with a date field that I need to show being <= the date parameter...

How/where do I use this criteria?

View 3 Replies View Related

Query Date From DateTime - General Date Format Field.

Mar 10, 2006

I have a date and time stamp in a Date/Time field of General Date format (3/1/2006 7:52:25 AM).

I wish to select query on the table's Date/Time field by date portion only (3/1/2006) and not include the time portion (7:52:25 AM) of the field.

Using this expression in the query's criteria - "Between [Enter Start Date: (MM/DD/YY Format)] And [End Date: (MM/DD/YY]" will not return the date ranges as desired without also typing in the full time string.

How can the date integer be parsed out and the query properly expression ed on the criteria field without using VB?

View 7 Replies View Related

Queries :: Set Up Query Which Responds And Filters By Date (Older Than X Date)

Jul 11, 2014

I currently have a query set up which responds and filters by the date.

I use the current code in the criteria on the query for todays date less 7 days

Code:
DateAdd("d",-7,Date())

This works perfectly and I had no problem with it. However I need to adjust the criteria so it is less than 7days ago OR OLDER....

How would I go about doing that?

View 4 Replies View Related

Queries :: Date Field With Time - Query For Date Only And Get All Records

Apr 26, 2013

I have a query based on a table which has a date field. the field both in the table and the query have the time also in the date value so when I try to query on a date I get nothing if I copy the date and time from the field I will get the result for that record if I just use the date I get nothing. I have tried the format which does display just date but if you click on the field the time is also there You must be able to query for a date only and get all the records.

View 11 Replies View Related

Reports :: Report Won't Sort By Date When Query Contains Date Formatting

Jun 21, 2013

A few months ago I created a report that displays the results of a long union query comprising a dozen or so individual queries, each containing an expression that yields a date (or sometimes date and time). I set the report to group by query and then sort by the date expression. Now for some reason that I can't fathom the report has always only ever offered me the option to sort the date "A to Z", I infer it thinks the date is text, but this misunderstanding has never actually stopped it sorting by date perfectly well. It worked. No problems.

However I have recently added formatting to some of the queries so that they just display date, not date and time e.g. Format([dateandtime],"dd/mm/yyyy"), and now the sort by date in the report no longer works. None of the sorting or grouping options have changed, but it now sorts just by the "dd" component of the date - so it thinks 21st June is later than 20th July. why?

View 14 Replies View Related

Queries :: Start Date And End Date Query?

Mar 26, 2013

I've attached a stripped down version of a small order database I'm working on.

A user would enter an order, the amount and the date the order is required by.

As you can see from tbl_seasons, the business has financial periods that match the first and last 6 months of each year. Each season has a start date and end date.

What I'm trying to build are two queries:

1. A query which lists all orders and has an extra field which shows the "season_id" that the order (date) relates to (based one the start date and end date in tbl_seasons)

2. A totals query which shows the total order amounts by season

how I might build these 2 queries.

View 2 Replies View Related

Hard Code TIME To Selected Date On Form (to Make It Date&time) For My Query Criteria

Aug 17, 2006

Hello buddies :D, do you have any idea how to make this work?

To select data that falls within this criteria of date range between cboDate and cboDate2 (fields on my form). The date in [tblJobDetails]![timeIn] come in this format "08/17/06 10:24 AM", but the cboDate/cboDate2 (takes in date only e.g 08/17/06) what i am after is to evaluate specific hard coded time in addition to the date entered, i.e. even tho, i haven't entered time on the cboDate/cboDate2, I want specific time hard coded where e.g If i select a date range of 08/17/06 and 08/18/06 on my cboDate and cboDate2 it should really be evaluating: 08/17/06 8:00 AM to 08/18/06 8:00 AM.

This is the criteria i curentlly have on my query in design view tha works perfect in selecting date only.
([tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Or [tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Is Null) And ([tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Or [tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Is Null)
How can I incorporate 8:00am to 8:00am into my cboDate and cboDate2. What can i do to make this happen? Your kindness will be greatly appreciated http://www.naijaryders.com/forums/images/smilies/thankyou.gif

View 10 Replies View Related

MAX Date Query - How To Have A 'unique' Date?

May 10, 2007

My database holds details of visits made to customers by support staff.
I am running a query which returns details of the last visit made to a customer as below with results displayed on a webpage.

SELECT Visits.Date1, customers.CustID AS customers_CustID, customers.Customer, Visits.CustID AS Visits_CustID, Visits.Visitee, Visits.VisitType, customers.RegionID, customers.NextVisit, customers.NextVisitBy, customers.Confirmed
FROM customers INNER JOIN Visits ON customers.CustID = Visits.CustID
WHERE (((Visits.Date1)=(SELECT MAX (Visits2.Date1) FROM Visits AS Visits2 WHERE Visits2.CustID = Visits.CustID)))
ORDER BY customers.RegionID, customers.CustID

SELECT MAX on Date1 is used to select the most recent (largest) date. The problem I have is that if 2 different staff members visit the same customer on the same day, the query logically returns 2 MAX date results for that customer, whereas I only want 1 result per customer. As the dates are the same I am not sure how to proceed. It doesn't matter which of the 2 results are returned. Does anyone have any ideas? Thanks in advance :)

ps - I can't perform MAX on the VisitID as the support staff don't always enter the visit data in the correct order meaning that an older visit date might have a higher VisitID than a more recent visit.

View 3 Replies View Related

Want To Query To Ask Date From And Date To

Mar 7, 2007

I have a database that has a query created, I want to refine the query to ask first for datefrom and dateto then display the relevant info between those dates.

View 7 Replies View Related

Modules & VBA :: Date Field To AutoPopulate Other Date Fields To Future Date

Oct 24, 2013

I'm trying to get my "IncidentDate" field to autopopulate two other date fields to a few days from the "IncidentDate". The other two date fields are "ContainDueDate" and "RootDueDate". I'm trying to accomplish this on my "Test CAP Form"

I tried using the following in the BeforeUpdate of "ContainDueDate" and received a complier error: expected =

Code : DateAdd(d,2,[IncidentDate])

so I removed the parenthesis and nothing happened

Code : DateAdd d,2,[IncidentDate]

I even tried redoing it in the AfterUpdate of "IncidentDate" and nothing happened either

Code : DateAdd d,2,[ContainDueDate]

I'm not sure if I'm even using the right function to get what I want.

View 4 Replies View Related







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