Sum Of Values If In Date Range

Mar 6, 2008

Hi,

I've graduated from counting records to summing values now!!

I've got the data set that is shown below



caseNo source Amount Vat Total Date Paid
1 ted £50 £7.50 £57.50 01/01/08



I've actually around 3000 records going back to 2004. What I need to do is make a report that will show the following.



Source Amount (financialYear) Vat(FY) Total(FY) Amount(thismonth) Vat..

ted £50,000 £10,000 £60,000 £5,000
Bob .....



I've created a function in the module that returns the financial year that the record is in called getFN() which works fine.

I use 2 text boxes to input the start and end date of the reports and use one of the text boxes as the input for getFN()

Basically, I can get a report that shows the values for each source in the financial year ok, and I can do the same for the values for the month selected but I can't join the two queries up in a single report.

I'm not sure if I need to have a blanket query that joins them. I'm a little stuck.

Any help would be really appreciated.

Steve

View Replies


ADVERTISEMENT

General :: Sum Values From Date Range From Specific Record

Mar 11, 2013

I'm working on a loan database for my personal use and obviously I'm new to access

See attachment ...

View 5 Replies View Related

Get Some Values And The Inmediatly Previous Ones Based On A Date Whithin A Range...

Jan 28, 2008

Hi everybody!

First of all, I didn't know how to search for the precise info regarding my question, so, If it is repeated, feel free to close this thread or delete it.

So, here it is my question:

I have a table with values taken once monthly, that is, for each person on that table, I would have a maximun 12 records per year. In that table I have the Id of the person, the date field where I store a date when I get the record, a field where I store a value and a control number field. The values on the control number field go from 1 to 20 (or less).

What I want to achieve is, given a range of dates, show the last two controls of every person, something like:
id, last control date, last control number, value of last control, previous control date, previous control number, value of previous control.
As you could see, I want to show in the same row the last two controls for each person, only if the happend to have two controls, if they have only one, it wouldn't be necessary to show them, so, how can I do this?.

Thanks in advance! :).

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

Print Date Range On A Report Based On A Non-date Field

Aug 7, 2005

Is there a way to show the earliest and latest dates of a report generated by a non-date field?

E.g. I generate a report based on Food, and it'll list the days that this food is associated with. Is there a way to show the first and last day that appears in this report (i.e. the range of dates that the report shows based on the food selected)

View 2 Replies View Related

Modules & VBA :: How To Check For Start Date In Date Range Only Combo Box Value

Jan 22, 2014

I have some code that filters job raised I have 2 text box's txtdatestart and txtenddate after entering. date range between the too text boxs it shows me all job raised with in the period.i have entered what I would like is filter it again by client field using combo box cboclient so if the user enter's client name in cboclient combo box and date range in txtdatestart and txtenddate it will only show jobs raised with in the date range of the client enter in the combo box but if the combo box is empty show.

Code:

Private Sub cmdPreview_Click()
'On Error GoTo Err_Handler 'Remove the single quote from start of this line once you have it working.
Dim strReport As String
Dim strDateField As String
Dim strWhere As String
Dim lngView As Long
Const strcJetDate = "#mm/dd/yyyy#" 'Do NOT change it to match your local settings.

[code]....

View 6 Replies View Related

Beginner Needs Help With Searching A Range Of Values

Aug 9, 2005

Hi,

Im a web designer by trade and know pc's fairly well, im trying to help a friend who is pc illiterate build a database.
It would help him out and be some practice for me (always wanted to have a bash at access but never had a reason to do so)

Im totally new to Access and im trying to do the following.

He is an estate agent and wants a database where he can enter his prospective clients looking for commercial properties to rent, one of their criteria will be the size range of the property they want. Then when he gets a new property on his books he wants to be able to search the client list by the size of the property and display the results of any clients that the properties size falls within their required size range (phew hope that makes sense)

In an ideal world hed like the results to include addresses so he can mail merge the results and send out letters to any clients who might be interested.

So, ive managed to create a table of all his client details but now im stuck on how the query should work, ive read the help files in access (which seem to be written in martian) and im just not sure how i should try and do this. I started to create a parameter query but ive gotten very confused with all the options.

I can see that i could put fields in my table of Min Size and Max size but im not sure how to design a query that searches a single value between these 2 fields

Ive had a look through this forum but cant see anything that covers this, im hoping someone might be able to point me in the right direction, either with some advice or a link to some online help that might help me understand what i need to do.

Thanks for taking the time to read this post, apologies if its in the wrong place or a totally noob question.

Any help would be very much appreciated

Many thanks
Dave

View 5 Replies View Related

Tables :: Interval Or Range Of Values

Oct 2, 2014

In a table, i have a field called operating draft (ships). I would like to be able to put an interval of data in this field, for example between 3 meters and 6meters. Indeed, for few ships the draft is flexible.

What kind of data type should i select and how can I set up an interval data.

View 1 Replies View Related

Reports :: Expression To Count Values In A Range

Sep 3, 2013

I have been stuck trying to write an expression that will calculate the Yes values in a range of 16 Yes/No fields.

I have attached a screen print of the report I am working on.

View 5 Replies View Related

Date Range Based On A Record Date

Mar 21, 2007

I am trying to filter out information for an ODBC query I have written, to obviously make it more concise. Because our data is not set up very logically, a lot of my queries are based on text...but that is another story. My current situation starts with a simple make-table query finding certain data within a date range. This is followed up by another simple make-table query to find other specific data within another specified date range. Then I have a cross-tab query between the two tables to locate all the data that shares the same unique identifiers. My problem lies with trying to only pull information from a certain date range. For example, I want information to be included if the data has the same unique identifier as well as falls within +/- 7 days of the received date (dd/mm/yyyy) also listed in one of the tables. Each record will likely have different received dates so I cannot set it as a constant.

Make sense to anyone? I am not confident enough to play around with some expressions...well it is more I haven't been successful at using them correctly.

All help is greatly appreciated.

Thanks,
Jay

View 10 Replies View Related

Selecting A Date Range For A Calc'd Date

Jan 13, 2008

I Have a table that I collect data for numerous ID's. One ID may have 5 dates that is was serviced. It is due to be serviced at set intervals which is calculated from the most recent service date. I'm calculating the next service date in a text box with the DateAdd func. =(DateAdd('m',[Cal Freq],[MaxCalDate])) with the MaxCalDate being a Max func in a different text box for selecting the most recent sevice date. I'm trying to update the [Next Due] field in the [Master Asset] table with the calculated next service date so I can do queries on items that are due service within a date range. If I do an Nex Due Expr1: in the queries to calc the next due service date then do a criteria on that Expr1: such as >=[Start Date] And <=[End Date] it states datatype mismatch? Is there a way to select a requested data range on a calculated type date/time? Or How can I update the [Next Due] filed in a different table?

View 8 Replies View Related

Date Range Within A Date Range

May 12, 2006

I'm trying to figure out how I can set a parameter on my query to search for any activity that occurs within a month, that falls within a date range. Specifically:

Criteria TextBox: 4/2006

Activity Start: 3/6/2006
Activity End: 5/5/2006

I want this activity to show in my query because the time between start and end occurs during the month of April. It's no problem setting this up for a specific date, ie 4/1/2006, but I don't know how to do it for an activity that occurs all days between 4/1/2006 and 4/30/2006..or for one that starts 4/12/2006 and ends 4/18/2006, or starts 4/12/2006 and ends 5/9/2006. etc.

View 2 Replies View Related

Date Range

Jun 18, 2006

Hi All,

I have a table of data, one of the fields is a date.

What i want to do is be able to have a query that can check if the date falls within a certain range - ie fiscal year and output in another column the fiscal year "code".

Ie: dates between 01/06/05 and 31/05/06 is fiscal year 0506
dates between 01/06/06 and 31/05/07 is fiscal year 0607

Could this query be dynamic so if a new fiscal year begins it would know to make the output the next fiscal year code???

Any help is much appreciated.

Cheers

Rudi

View 1 Replies View Related

Date Range SQL

Oct 10, 2006

I have two tables: tblClasses & tblSchedule. There are joined by ClassID. For each class in the tblClasses there are several records with date field in the tblSchedule. (So each class stored in tblClasses happens on multiple dates stored in tblSchedule).

I want to create a query (SQL view) that would take two date inputs from a form(date range): datefrom & dateto, and return any class of which FIRST day of classes falls in between those dates.

(Or: how can I add a field to my query called [First day of class] that would basically have the value of the first date from the tblSchedule for the joined classID?)

View 2 Replies View Related

How To Use A Date Range

Nov 19, 2007

I need to get records between two dates. Here is my query:

SELECT WGMAHIST_TIMEDTY.TDYPT, WGMAHIST_TIMEDTY.TDYCO, WGMAHIST_TIMEDTY.TDYSSN, WGMAHIST_TIMEDTY.TDYFND
FROM WGMAHIST_TIMEDTY
WHERE WGMAHIST_TIMEDTY.TDYSSN = 464299266
AND WGMAHIST_TIMEDTY.TDYEDT >= #06/29/2007#
AND WGMAHIST_TIMEDTY.TDYEDT <= #09/21/2007#
AND WGMAHIST_TIMEDTY.TDYPT = 1
AND WGMAHIST_TIMEDTY.TDYCO = 8

I am obviously doing it wrong because I keep getting an error that complains about the key work BETWEEN.

How can I make this work? I am using MS Access 2007.

Thanks,
wgma

View 5 Replies View Related

Date Range Using IIf Help

Apr 7, 2008

I have a form with a combo box containing the names of the Months. What I want to do is then pass the Month name to a query as a date range. For example, select "May" from cboMonth and the query will check the date field for "between 05/01/2008 And 05/31/2008"

Here is what I have in my query but it does not show any records when I run it:

IIf([Forms]![Form1]![cboMonth]="May",Between #5/1/2008# And #5/31/2008#)

Is it even possible to use this type of an expression in the query?

Thanks......

View 8 Replies View Related

Date Range Help

Jul 14, 2005

Hello - I am trying to create a FOrm that will allow the user to type in two dates. From these dates a table will be created and displayed in a List Box.

Does anyone have a very simple example of the code

1. I am trying to write two input boxes to variables.
2. On click I am displaying a message box that repeates the values of these two variables
3. When they hit OK I want the records to appear in the ListBox.
4. From this point I will want to get the data to a report of some kind.

I am very new to this and am trying to see if someone has any code examples....

This is the code I have so far.....Actually I cant get passed #2 above. It shows the message box and the text but not the values of the variables...

I dont think I am using the variables right......I dont understand the syntax needed to write an input box value to a variable......

Please Help....

THanks



CODE:

Option Compare Database


Private Sub BeginingDate_BeforeUpdate(Cancel As Integer)

Dim BD As String

BD = BeginingDate.txt


End Sub

Private Sub EndDate_BeforeUpdate(Cancel As Integer)

Dim ED As String

ED = EndDate.txt

End Sub


Private Sub Command5_Click()

Dim var_BeginingDate
Dim var_EndDate

var_BeginingDate = BD
var_EndDate = ED

MsgBox "The Variable is " & var_BeginingDate & " and " & var_EndDate, vbInformation + vbOKOnly


End Sub

View 10 Replies View Related

Date Range Query

Aug 25, 2005

I am trying to extract records within a certain date range.

My structure is as follows:

Query 1 = pulls data direct from a table. There is a date field which is in the format YYYYMMDD.

Query 2 = pulls data from Query 1 and amends the date format to:
dd/mm/yyyy

Has anyone any suggestions on how I pull data from query 2 from within a certain date range. i.e 01/01/2005 to 01/05/2005

Thanks

View 4 Replies View Related

Between Date Range Conflict

Oct 2, 2006

I am working with a linked table that has a field [Originated Date]

I have created a query for this table and on the criteria for [Originated Date] I put the following:

Between [Forms]![Date Input]![StartDate] and [Forms]![Date Input]![EndDate]

I am using a pop up calendar to populate [StartDate] and [EndDate] fields on the form.

The format of the Date field in the linked table is "Text" not sure if this is the root of my problem ?

When I run the Query Manually and input the [StartDate] as yyyy/mm/dd and the [EndDate] as yyyy/mm/dd the query returns the desired results; However when I run the query with from the form It does not return the desired results.

It is driving me crazy not sure where the discrepency is ?

View 7 Replies View Related

Query Date Range

Jun 8, 2005

I have a query which requires date parameters, which the user enters into a form. The form enters the parameters into 4 different queries then runs them to produce a report.

This all works fine EXCEPT for one query.

If I enter my desired date range into the query (in this case it is between 01/11/2004 and 30/04/2005) it returns no results. As the only values in the date fields of the table are 01/03/2005 and 01/04/2005 it should return all the records.

However if I enter the date range between 01/01/2005 and 30/04/2005 it works fine. It also works if I enter 01/01/2000 and 31/05/2005 - it just doesn't seem to like the year 2004!!!

The problem occurs whether I enter the parameters from the form or simply type them into the criteria of the query. Any ideas, it's driving me nuts!!

View 4 Replies View Related

Putting In A Date Range

Jul 20, 2005

I'm a beginner to Microsoft Access, and I just started working on a project for a marketing company I work for. I have to build them a pretty straightforward database which has tables including Clients, Contacts, Vendors, Employees, Timesheets, etc. The point is to have any employee be able to work with the database and enter any piece of information they have into it. Again, it's a pretty straightforward database. Right now, I am working on a search form for specific jobs. For example, if they need to design a website for a particular company, that specific website job will be entered into the jobs table. I am working on the search form right now so that they can search for specific jobs and they will come up.

One of the sections of the form is a date range, for date received. For example, this would apply if they wanted to search for all jobs that they received between 1/1/05 and 7/10/05. In the query that I am designing for this form, I have the table entry "Date Received" apply to both of the two boxes in the form (I titled them "What Date Received 1" and "What Date Received 2"... my boss advised me to title the boxes in the search forms "What ___" to not get them confused with the forms displaying the information). In the query, the code I am using right now for Date Received is this:

Between [Forms]![Search Jobs]![What Date Received 1] And [Forms]![Search Jobs]![What Date Received 2]

I've also tried this code:

(Between [Forms]![Search Jobs]![What Date Received 1] And [Forms]![Search Jobs]![What Date Received 2]) Or IsNull([Forms]![Search Jobs]![What Date Received 1]) Or IsNull([Forms]![Search Jobs]![What Date Received 2])


The first code works if I have things entered into these boxes. However, if I try to search and leave these blank, I never get any results. I tried playing around with some "IfEmpty" statements, but none of those worked. The second code doesn't work either. Does anybody know how I should modify this statement so that if the "Date Received" boxes are empty, it just ignores it? Thanks a lot.

View 2 Replies View Related

Date Range Criteria...

Aug 22, 2005

I am wanting to use a query to find dates within a range, like a quarter. Within the criteria I put "[Enter Date:]". I ran the query and tried the "Between..And.." operator and even "<=9/1/05 and >=12/31/05". All I get is an error message saying incorrect syntax or structure. Any questions on how I could set this up so I could perform this search, that would be great.

Thanks. :confused:

View 4 Replies View Related

Count Between Date Range

May 8, 2006

I am trying to run a query on a table [tblMain]. I have an input form where the user enters a date range. I would like to count the Month to Date Sales. The month would be that of the end date (forms!frmflash!enddate). How could I count the number of sales between the first of the month and the end date? Each record has a salesdate1, salesdate2, salesdate3, salesdate4, salesdate5, and salesdate6. I need to look in each of these fields and count the sale if it is between the 1st of the month and the enddate.

View 3 Replies View Related

Append A Date Range

Nov 27, 2006

Hi Guys

Can someone please help me with this? I have an Events form which has some date fields setupdate and enddate. There is a linked events calendar subform attached. I have attached the database for you to see.

If you open the events form and go to the events date tab, I want to be able to type in the dates in the setup and end date fields, and then run a query which populates the events calendar subform. I created a date table (dates) with a list of dates and tried to create an append query (Query3) with those fields as criteria which didn't work as it wasn't recognising the parameters (but i'm guessing that is because it wasn't attached to the Events Form). However after entering the dates, I was able to append them to the events calendar only after including the EventsID field to the dates table and the query. This however means that the records aren't linked to the Events table as the EventsID field is blank (the EventsID is what links the E.Calendar subform to the Events Form). Therefore though the records were reflected in the events calendar form, it wasn't showing up on the events form.

I dont know if this makes much sense but what I basically want to do is a series of functions. Create a query which extracts a set of dates based on criteria entered into the main form, and appends them to a datasheet subform which is linked to the main Events form via the EventsID, then copies the Event ID for all the recordsets that have been added.

Is this possible? Thanks for your help in advance.

View 2 Replies View Related

Date Range In Query

Feb 8, 2007

Hello all

I was wondering if anybody could help me out with a query problem I've been having.
I've been trying to use a query to display a list of available cars for a given start and end date entered by the users. I have found some guidance to make an attempt but it isn't working. The text in the Input boxes isn't what I'd like. Also the query is displaying all the cars in my database even when I deliberately trying to exclude some.
I'd really appreciate any help As this is my first database and Im really struggling with the use of criteria.
I've included a screen grab including my formulas

http://img.photobucket.com/albums/v242/b3rnie/access_screen.jpg

Apologies if I've missed this advice in my searching

View 3 Replies View Related

Date Range Query

Jun 19, 2007

I am trying to design a report that uses a range of dates as column headers. The row headers are vehicles and the intersection between the columns and rows will display details about that day's vehicle usage.

To do this I need a query that will produce a row of date headers based on parameters from a form. Also, the report needs to display date headers even for days on which no events occur.

Any ideas?

See also:
http://www.access-programmers.co.uk/forums/showthread.php?t=130335

View 1 Replies View Related







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