Queries :: Specific Date Range Based Off Of Other Data
Jun 14, 2013
I have multiple buildings that I own. Each building earns a monetary amount each day. Some days they earn $0, some days they earn $1,000. This is all kept track in a data base in which someone manually enters the information each day.The three fields are:
Building
Date
Profit
I have narrowed a query down to one building, and I am interested in two things. How do I write a query that shows a 30 day peak (the most profitable 30 days). In other words. I want to see the following
Building: GNB Tower Date: 02/14/13 - 03/15/13 Profit: $25,162
The next thing I am interested in is a 7 day peak from within these 30 days. This shouldn't be too difficult if I can figure out how to query these 30 days, I can query 7 days out of those 30 days. So this bigger mind stumper is the first one.
out of a date range of months and months (Let's say 10/12/13 - 6-14-13).Once I figure this part out, I am sure I can figure out how to compile all buildings into one large report with their 7 day peak and 30 day peak.
View Replies
ADVERTISEMENT
Aug 21, 2013
I have a weekly list of transactions that come in the format DD/MM/YYYY HH:MM:SS, I need to tag these individual transactions with a week number. The problem is, I can't use the Datepart function etc. as the day is classed as running from 8am to 8am rather than midnight. I have a list of all of the weekly date ranges for a few years (with the time) so I was able to solve this problem in excel by using the Index and Match functions. However, I'm trying to automate this process as much as possible so I'd rather perform this function in Access.
View 4 Replies
View Related
Jul 14, 2007
so i have an interesting question and im hoping that someone can help on this one. i need to pull date from a specific table, no problem, that's written and working fine, next i need to be able to join the data from another table by a primary key, again no problem. third, i need to be able to select the date (using WHERE) for a specific date range. (i.e. i enter the date range of 01/7/2007 to 15/7/2007) and the query comes back only showing the data from that specific time, not the data from before or after. this is where my problem lies, all the entered data is being shown after entering my date range. i am going to include my SQL statement, just so you can actually see what im really talking about.
SELECT srealest.Name0, srealest.Dist1, SREpayments.Face2Pd, SREpayments.Penalty2Pd, SREpayments.[2paid], SREpayments.Face3Pd, SREpayments.Penalty3Pd, SREpayments.[3paid], SREpayments.Face4Pd, SREpayments.Penalty4Pd, SREpayments.[4paid], srealest.Map, srealest.Parcel, srealest.LeaseHold, srealest.TaxRebate1, srealest.TaxFace1, srealest.TaxPenalty1, srealest.TaxYear, srealest.BillNo, srealest.PdRebate1, srealest.PdFace1, srealest.PdPenalty1, srealest.DatePd
FROM SREpayments INNER JOIN srealest ON SREpayments.BillNo=srealest.BillNo
WHERE (((SREpayments.[2paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]) Or ((SREpayments.[3paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]) Or ((SREpayments.[4paid]) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date])) Or (((srealest.DatePd) Between Forms![SD SRE]![Beginning Date] And Forms![SD SRE]![Ending Date]))
ORDER BY srealest.Name0;
any thoughts or ideas on how to accomplish this would be greatly appreciated!
View 2 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
Jan 22, 2014
I am trying to calculate the total hobbs time (Ending Hobbs - Starting Hobbs = Total Hobbs) based on a user inputed date range. The query that I created (see attachment) doesn't seem to give me what I'm wanting.
View 14 Replies
View Related
Apr 8, 2013
I have a query that I want to "filter" based on a date derived from a Build statement (Expression). The Build statement works I can even sort by "Ascending".. But when I try to add a "Between [Startdate] And [Enddate] statement in the Criteria box, returns nothing".
Build statement : ReInvestDate: IIf([Eligibility]="SCI",DateAdd("d",+1825,[PrevInvestDate]),IIf([Eligibility]="TS",DateAdd("d",+1825,[PrevInvestDate]),IIf([Eligibility]="S",DateAdd("d",+3650,[PrevInvestDate]))))
View 8 Replies
View Related
Jul 29, 2013
Context is I have a TABLE 1 that has a record for every package shipped with various details about it, include how it shipped, and the date. Table 2 is a key to go from the ship method to a better grouping we deem service level. Table 3 is a Fuel Surcharge (FSC) Table. It includes various FSC % that vary by different service levels and different date ranges. In the end I need to know the amount of pkgs shipped (by month and servicelevel) and the relevant FSC.I have several tables in my database but we should be able to focus on 3 to explain my situation and only the relevant fields:
TABLE 1 (Main Data):
ShipDate
ShipVia
Table 2:
ShipVia
ServiceLevel
FSCType
Table 3:
FSCType
StartDate
EndDate
FSCPercent
DESIRED RESULT:
Month
ServiceLevel
FSCPercent
PkgCount
Table 1 is Left join on Table 2 based on ShipVia
Table 2 is Left join on Table 3 based on FSCType
The issue is Table 3 is dependent on Table1.ShipDate being between the date ranges as well.
There are overlapping date ranges, however they are differentiated by the FSCType field.The only semi-feasible solution I currently have is to expand Table 3 to include every date, and not date ranges. This will create an issue due to size of date ranges etc.
View 8 Replies
View Related
Aug 29, 2013
I have recently set up a button that exports multiple queries to one Excel file, using TransferSpreadsheet code. This works great and saves a lot of time, the only thing is on many of the queries I have a date range set, so you have to enter a date range to get the results.
Is there away that once I press the button I enter the date range once and than it exports the rest of the data based on this range, rather than entering the same dates multiple times.
View 1 Replies
View Related
Mar 30, 2015
I atrying to make a query that shows the price for a product, based on two parameters.
Parameter one is a product code.
Parameter two is a date. This date falls between two dates.
I have one list (table) where is product code and invoice date.
The second list (table) I have, contains product code, and price valid from date, and price valid to date columns. This price valid to date is often not filled, and the price I still valid as we speak. If the date is filled there is often a new entry with an updated price. But sometimes, even if there is a new entry in the table, the date 'valid to date' is sometimes also not filled.
I would like Access to show me the valid price for the specific product. What criteria should I give in the macro, in order that Access shows what I want?
For illustration purposes, a small overview of my table:
Product code, Price, valid from, valid to
AAAA, 12000, 01.01.2012, 31.12.2012
BBBB, 16600, 01.01.2012, 12.06.2013
AAAA, 13500, 01.01.2013, 28.08.2013
AAAA, 11500, 29.08.2013,
BBBB, 17600, 13.06.2013,
Product, invoice date, price according to price list
AAAA, 02.05.2012, ????
AAAA, 01.08.2012, ????
BBBB, 10.06.2013, ????
AAAA, 31.10.2013, ????
AAAA, 16.11.2013, ????
If you happen to know how this search can be performed in Excel, I am of course also happy to read that. (But my index, or Vlookup functions, give only the first possible result in the table. As I do not know how to give in the date parameter.)
View 11 Replies
View Related
Aug 11, 2014
I have a drawing register database which notes the revisions for all drawings issued. One drawing can be revised several times so I have a details table which notes the revision letter, date issued and the notes for each revision. Using this table I created a max date query to show the latest issue date and revision for each drawing. This query is used for a transmittal form for issuing drawings. Both the form and report is working perfectly.
The TBLTransmittal consists of the following fields
ContractName
IssueDate
SubSup
DwgNo (multi-value checkbox)
Using the TBLDwgRegisterDtls or the query QRYDtldDwgReg (which includes the drawing titles) I would like to create a query that would look up the latest revision at the date of issue and show the revision letter.
I started a query combining TBLTransmittal and TBLDwgRegisterDtls and in the criteria for DateIssued of the TBLSDwgRegisterDtls (which is when the drawing was issued by the architect to the contractor) I put "Not > [IssueDate]". This is filtering the information to show revisions issued up to the date we (the contractor) issued the drawing to our sub-contractor but I need now to pull the max revision only from this information.
Before I go I will give you an example of what I want from the end result
Drawing BK2-02 rev. D was issued by the architect to the contractor on July 17th. This drawing was in-turn issued to our sub-contractor (Sub "A") this Saturday, August 9th. The same drawing was revised this morning and rev. E was issued to Sub "A" today, August 11th.
I want the end report to show that Sub A received Rev. D on 09-08-14 and Rev. E on 11-08-14.
I'm wondering if another max date query on this new query would work? I'll try and see what happens.
View 2 Replies
View Related
Dec 12, 2007
Hi all, I need to extract in a query a recent range of records, these records should be all before a certain date and all the following future records example:
if today date is 12/12/2007 I need to extract all records that are dated from the 1st of november and all the records that come after the 12/12/2007.
In the criteria I have set "Date()" what else should I be adding to get the range mentioned above?
Thanks
View 5 Replies
View Related
Jan 12, 2006
I'm having issues with reports. What I want to do is only print specific dates in a report. I have read and tried everything to accomplish this but it just isn't working. Any suggestions????????????
View 2 Replies
View Related
Jun 26, 2014
I want to make a delete query, which delete record between certain dates, I want access to ask user to specify range of date before executing the query.
View 11 Replies
View Related
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
Oct 26, 2007
Hi I could do with some advice on how to start the following and if best to use both excel and access to achieve it.
I want to enter a range of data when I receive a bill such as date, supplier, bill amount, description, quoted price, customer job and retail price. Once I enter this I want to be able to do the following,
1.Pick a customer job and date range and get a report for all the details of bills received in relation to that customer in that time so that I can send the customer a list of items they bought in that time period and what each item cost.
2.I want to be able to compare cost prices from different suppliers and print a list of all items which shows who the preferred supplier is for each item based on the cheapest.
3.The quoted price from suppliers should automatically appear when the description and supplier has been entered.
4.There needs to be some sort of warning if the quoted price doesn’t match the bill price
5.I need to be able to get a report which gives the details for any bill which was entered that was not bought from the preferred supplier.
Some advice on pointing me in the right direction to get started is what I need and would be greatly appreciated
Thanks
Adw
View 6 Replies
View Related
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
Feb 28, 2014
I am trying to connect to excel from Access database. Once I make the connection I want to delete data from a range on a specific sheet. There are 4 columns on the spreadsheet but i wouldn't know how many rows. So for example, A150... but I may not know what the last row is. How would I be able to delete data from a range of columns to the last row?
View 4 Replies
View Related
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
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
Jan 24, 2006
ive got two tables that i need to merge.
I need the join to work so a date within table b links to a range in table a of 2 columns start and end- is it possible?
Ie
Table A
patient number
admitted date
discharged date
etc
etc
Table B
Patient number
operation date (will lie in admit dis date)
NB a patient number may exist in table A and not B, or table A twice at differnt times and B once.
thanks, ren
View 1 Replies
View Related
May 23, 2005
Hi everyone, I am hoping to learn something new about access today. What I need is to be able to run a query that gives me rows of data based on paramenters that I specify. For example, I will query this all just on one table and I want to come up with an output that is in a nice format as follows:
Parameter..........................Member Count
01/01/04 thru 01/20/04...............298
02/01/04 thru 02/20/04...............287
03/01/04 thru 03/20/04...............301
04/01/04 thru 04/20/04...............254
And so on, usually for a calendar year.
Basically each member has an effective date, like member A might have 01/15/04 effective date and member B might have 01/02/04 effective date. I need to capture the count of members by month based on their effective date range. I would like to do it all in one query like above instead of just running a query for January, then February, then March, so on.
Is there a way to do this? Right now I am just running a query and getting one member count at a time and copying that number to an excel spreadsheet. it works okay, but is time consuming. I would rather semi-automate things for me. Any ideas?
Oh and I am new to access, by no means an expert, so be gentle with me.
Thanks,
Hanna
View 2 Replies
View Related
Jun 19, 2007
I have a database with several clients who have a series of appointments. I want to be able to create a report of all the clients to be seen during a range of dates to be inputted by the user. All help would be greatly appreciated.
Andrew
View 1 Replies
View Related
Jun 28, 2006
I have developed a Debt Management program for work but I am stuck on a feature that we need to add to it. Basically I have a table which holds "planned future transactions". These are ad hoc transactions that need to be added from time to time to the clients budget. For example the client might have $500 a quarter for school fees for the next two years or he might receive a bonus every six months for the next 5 years. Currently we are putting these in manually but it is tedious and is causing complaints. The feature I require is to be able to add a record such as the school fees, nominate that this fee is paid every three months for the next 8 quarters and get the system, say through an append query? to create 8 records, each with the appropriate date 3 months after the previous one.
Any suggestions or assistance would be appreciated.
Thankyou
View 1 Replies
View Related
Feb 4, 2008
I have form with two date text boxes. One is start date and the other is end date. I want to query a table and only pull records that the date field is between the start date and end date.
my code I am working on is:
Dim startdate2 As String
Dim enddate2 As String
Me.start_date = startdate2
Me.end_date = enddate2
Dim SQL As String
SQL = SELECT FROM 'project' WHERE Date between 'startdate2' and 'enddate2'
DoCmd.RunSQL SQL
I am getting a error on the sql = statement, I can't seem to get the statement right.
View 4 Replies
View Related
Sep 7, 2012
I have 2 tables like this
TableA
FromDate
ToDate
BatchType
TotalBatches
TableB
Date
BatchType
NumBatches
Is their a way to update the TotalBatches in TableA with the sum of NumBatches from tableB that have the same BatchType and falls between the FromDate and ToDate of TableA?
View 14 Replies
View Related
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