Previous Month
Apr 24, 2007I searched but could not find a simple answer.
I want to see all results from last month for [TestDate]
Month(Date())-1) ? ? ? ? ? ? ?
I searched but could not find a simple answer.
I want to see all results from last month for [TestDate]
Month(Date())-1) ? ? ? ? ? ? ?
I have a query with the following fields:
[Clinic] [Month] [Year] [NewPatients]
Some of the calculations I would like to do are based on the number of new patients that a certain clinic received in the previous month. Does anyone have any suggestions on how I can create a field that has the number of new patients from the previous month?
What I have is this:
PrevMonth: DLookUp("[NewPatients]","ClinicQuery","[Month] = " & [Month]-1)
What I can't figure out is how to account for the fact that I have multiple clinics in the [Clinic] field and each clinic has multiple years in which it was receiving new patients. The PrevMonth statement above works fine for the first clinic listed in the query during the first year it received patients (entries are sorted by month and year), but then just repeats these data for each subsequent year and clinic. Any ideas?
Thanks in advance for any advice!
How to get the last Thursday of previous month?
For 5 particular queries I need to pull the date range starting at the last Thursday of the previous month forward.
i need 2 comboxes. 1 with year and 1 with month. the year is easy just do this in rowsource sql:
SELECT DISTINCT (DatePart('yyyy',uitvoering.begindatumtijd)) AS Jaar
FROM uitvoering;
but the month is a lot harder because it needs to show the months where the year is the same as the combox with year and only show months where there is data in my table. for example i have data for only 3/12 months in a year then i need to show only those 3 months.i made this in vba because i think it can't be done in rowsource with sql code.
Private Sub Tekst19_Click()
Dim year As Integer
year = Me.Tekst17.Value
CurrentProject.Connection.Execute "SELECT DISTINCT (DatePart('m',uitvoering.begindatumtijd,,)) AS Maand FROM uitvoering WHERE (DatePart('YYYY', uitvoering.begindatumtijd)) = year"
End Sub
I have a query based form i use to gather data to generate a report. I have 2 forms Form A is where users open all reports from. On form A i have 2 unbound fields "Report Start Date" and "Report End Date" my queries us these from Form A as the criteria for the queries. I have like 30 reports using this method and it works great. I am now building 2 new reports, a monthly and a weekly report. These reports required and data entry point so i built "Form B"
I created my tables for these reports and went through and created the records. So when a manager needs to enter data for any given report they would us "Report Start Date" to identify what record they want to work with, so if they want to enter data for the December report the would select 12/01/2014 and then open "Form B". This works great and the report looks as good as any Access report can.
Now they are asking to add to "Form B" a comparison to the previous month or week depending on the report. for example:
This month we did 250 units
Last month we did 300 units
so we did 15% less
"Yes my math is not exact"
They don't need to see last months data but i need a way to query the previous record to compare the data
This is the criteria code i use in the query that "Form B" is based on.
Code:
[Forms]![Form A]![Report_Start_Date]
I am pulling up the 12/01/2014 in "Form B" but need the 11/01/2014 record floating behind to compare data.
How can i use the same setup but pull a 2nd record? I am thinking i can use a 2nd query but with different criteria.
Hello,
I've been looking through the archives and learnt a fair amount about date manipulation, but am still a bit stuck. I'm sure there is a way to do this and would appreciate any ideas:
Basically I am monitoring changes in Fuel level over months. For each month, I have a variety of readings, each on a different table, including sales from that tank, delivery in to it, and most importantly a closing dip reading taken at the end of the month.
In order to figure out the change in Fuel level over each month, you need an "opening" figure : this is taken to be the closing dip value of the previous month. And this is where I'm getting stuck!
I am writing a query to generate new table which combines all the relevent values. I have managed to link them through the date field, even though the specific date is not identical what matters is that it is the same month. Effectively I am trying to add a new 'column' showing the opening value, where opening value = previous months closing value for this tank.
I noticed there is a post talking about previous month data <a href="http://www.access-programmers.co.uk/forums/showthread.php?t=39708&highlight=previous+month">here</a>, which gives me some ideas but I'm not sure how to go about putting this into the SQL query. I can't use Date() because I'm interested in more than just previous to THIS month - the data spans back over a year!
I'm still learning Access so this might be a simple question - if so please point me to the relevent parts of the help file!
many thanks
Catherine
I am trying to create a database that will keep track of the orders placed for a given part number by month. Currently, my table houses the part number, and the ordered amount for the past three years by month (there are thirty-five columns for every part). My column headings are ORDER_MAY_2013, etc. I would like to set a query up that will look at the column headings and pull the amounts ordered for each part for the past twelve months. In other words, I have three years of data in my table. In my query, I just want one year. However, I don't want to have to rewrite the query every month so that it will pick up the new data. Is there a way to accomplish this?
Is there a better way to build this database? I thought about just have four columns in my table - PART_NUMBER, ORDER_MONTH, ORDER_YEAR, ORDER_AMOUNT. The only problem there, is that every part (there are about 450 parts) would have to be listed 35+ times. That seemed too redundant to me, so I built the table this way. However, now I am having trouble querying against it.
I have a MS access table with 12 numerical columns for 12 Months payments for our customer base.
I need to calculate variance of payments month on month and identify set of customers who have made huge payments.
I have a table full of dates of meetings through out the year...
Example
tMeetingDates
16th August 2005
18th September 2005
19th October 2005
23rd November
-----
i also have a report that i print out each month that has the date of the meeting on it... i currently edit the date manually.
I was wondering if there was a way to automate this facility, so that the report looked to the table of dates and looked for the current Months Date that is stored i the table.
i then want this date to be displayed in the Report.
So in this instance if i am running a report for tomorrows meeting being the 19th October it would display that date in the report....regardless of when i run the report...
Obviously if i run the report on the first of November because the month has changed it would then display the date of the November Meeting...
we only ever have one meeting a month!!!!
Please help
Andy
Using Access 2010..I have form with a date on it. For this control I have show date picker set to "For dates" and lo and behold I get calendar! I can scroll through this calendar month by month. Great if I just want to go back or forward a month or three. What I'd like to be able to do is scroll through the calendar year by year. Can I do this with the method I'm using at the moment? If not is there a way round it that isn't over complicated?
View 6 Replies View RelatedHiI have a field that is text which holds the month in form "oct" etc. I need to pass the numerical value of that month to a function so how do I create an expression that will change it (in this instance) to 09.kind regards in advance.peter
View 5 Replies View Relatedplease help me
i have a date field called open & i need to generate a query to count all entries by month, so far i can get all cases each day, but i'm unable to get the query to count them just based on the month & year..
any ideas please
I want to add a default value to field in a record, and it needs to be the value of the previous record plus one.
Ive searched the site and tried access help but to no avail.
Any help would be gratefully received
Thanks.
how do i put criteria into a query to only retrieve records from the previous working day, but if the previous day is saturday or sunday (current day monday) it knows to go back to friday and ignore weekends as they are not working days.
thanks in advance guys
ian
Is there a way I can grab the previous record's value without using dlookup? I am trying to create a running total in a datasheet view. e.g.
Date Credit Debit Run. Tot.
6/1/06 $25 $0 $25
6/4/06 $30 $0 $55
6/9/06 $0 $50 $5
I could do it by using an autonumber but the data is sorted by date and not by the order in which it was entered. Suggestions? :o
:confused: Need help building a query that will subtract the previous value from the next value at each change in date
Date Tier 1
1/6/2006 4.22
1/13/2006 4.27
1/20/2006 4.27
1/27/2006 4.314
2/3/2006 4.314
for example, 4.22-4.27 = -0.05
I have an inventory report that I am given among the fields are
Item, Ship Date, Signed Quantity, Filled-Recvd, On Hand
I am given an initial amount in the onhand field but the fields below that for that item are blank.
What I would like to do is [Signed Quantity] - [Filled-Recvd] and then add that to the On Hand from the previous record and place it in the on hand field..
If it were in excel I would say G2 – H2 + I1
G = Signed Quantity
H = Filled-Recvd
I = On Hand
TIA!
Scott
Hi there, I quickly made a database, and for some reason, can't get past this 'cancelled' error, to get it to occur, open the Companies form, click orders and then it pops up.
By deleting all of the data in my tables, I can get to a state where I can once again enter data, but after closing the orders subform and opening it again, once again I have the dreaded error.
If anyone has any ideas of why this may be happening, feel free to share them :P
Thanks alot,
James Prince
Edit,
Here's my table structure:
CompanyID PK Autonumber - Relationship
Name
Address1
Address2
Town
PostalalCode
TelephoneNumber
FaxNumber
OrderID PK Autonumber - Relationship
CompanyID - Relationship
WeekNumber
Price
PriceWithVAT
MPL Autonumber
OrderID - Relationship
PartNumber
Size
PriceEach
PricePer100
Quantity
Basically I used the forms wizard to create a linked sub form, and when moving to a new order thats when it errors I think.
Hi Guys,
I'm pretty new in the access world and I'm trying to build my first Database! I've a question (I bet really simple): I'd like to know how it is possible to keep previous data that I've entered in a form when I open it a second time.
Thanks a lot for you help
Okay,
What I need to do is two fold. I have a table in which I track clinets coming in and using our services.
Question 1: I want to be able to have a a date field default to the date I first type in when I open the form and remain there in all
subsequent records till I change it. The data is only entered once a week and we usually have 400 client visits per week
with about 75 - 120 per day. So it kind of gets repeatitive to keep typing in the date. I am aware of the CTRL+', but the staff who use this database do not even want to do that.
Question 2: Next problem....How would I create an autocorrect function that will automatically fill in a name...i.e. I begin to type jo and it will automatically fill in the hn...but I want the values to come from previously entered data from past records, similar to the way Excel does it in spreadsheets.
Any Ideas would be greatly appreciated.
can someone help:
in a form I've created showing products bought, when I add a new new order it still keeps the previous order's data, how can I prevent that from happening?
cheers
Is it possible for me to specify the default value in a table as what was inputed in the previous record?
View 12 Replies View RelatedGreetings,
I am just posting a follow-up on my previous post on designing functional forms. Telling by the lack of replies, my original question may have been long winded and tedious. Let me try to narrow my question and make it more concise.
In two tables connected by a one-one field name ProfileID, how can I set a new field in the second table (call it StepNo or procedureNo) so that it increments step numbers for each unique ProfileID record? Thus for each new Profile record created in the first table, a new form will allow the entry of X numbers of steps into the second table and automatically link the two records?
I hope that clarifies my problem. Thanks in advance.
I'm a novice with Access but I thought I would use Access rather than Excel to record fuel use for our vehicles because the reporting functions should be more powerful.
I have set up a table where I input date, vehicle, member of staff, mileage of the vehicle and the cumulative reading from the fuel tank meter. I thought it should be simple enough to calculate the fuel used each fill by taking the meter reading away from the reading on the previous record, but I cannot find a way of getting Access to do this.
I am missing something obvious or not?
Thanks,
Henry
Hi
Im wanting to set a default text from a previous record.
I have a fields that has Start location and Finish location,
Im wanting to set a defaulf so that the Finish location from the previous record is defaulted to the Start location of the next.
Is this possible????
Please help.
hi all,
i m having a problem with a simple inventory system. The problem is that i have a query which calculates sum of 'Debit and credit' as 'Balance1' for each row. Now what i want is to add every 'Balance1' to next sum of 'Debit and credit'. e.g.
Debit Credit Balance1 Balance2
a b a+b (a+b)
c d c+d c+d+(a+b)
e f e+f e+f+c+d+(a+b)
I would to generate column 'balance2
Any help would highly be appreciated.
Thanks