On a form I have 2 textboxes, 1 for user input, the other a calculated date. The two values together represent a "Leave Year". The second textbox contains, [Firsttextbox]&" - "&([Firsttextbox]+364). Simple enough so far. The expected result from entering, for example, 2/10/2015, is 2/10/2015 - 2/9/2016, which is exactly what I need. But, using a hard figure like 364 will fail on 3/2/2015 when the extra day in Feb 2016 results in, 3/2/2015 - 2/29/2015. To compensate for this, I've added,
"=IIf([Firsttextbox]>"2/28/2015",1,0)" to a third textbox and added it to the calculation as follows;
[Firsttextbox]&" - "&([Firsttextbox]+364+[Thirdtextbox]) So far so good....almost.
The "Leave Year" calculated is what I want, until 10/1/2015, when something goes awry. At 10/1/2015, the expression in the third text box evaluates to 0,and I lose my extra day.
If the calculation is an Access 2007 problem/issue, will it evaluate correctly if it's migrated to a new version?
Another thing I need to do is similar, in that a date is entered and calculated to 7 days prior. If the calculated date falls on a Saturday, I need to have it adjust to Friday, the day before. Also, if another calculated date falls on Saturday or Sunday, I need to have it adjust to the following Monday. These are two separate calculated fields, but both are necessary.
I have a date textbox (Week_Ending) and number textbox (Staff_ID) in a form (frmHourEnter), when both have values I open another form (frmStaffReport) with textboxes (txtDateStart and cmbStaff).
How do I open the second form with the values of the first form pre-entered?
I have a database for billing. In my database, I have a form that consists of a main form "Order" and 2 subforms "OrderDetails" and "Customer" OrderDetails are to enter the products to be connected to the Order. All function super, but I want to have some information from one of the forms "copied" over to on of the others.
Here is what I would like
In the subform "OrderDetails" I have made a textbox that summarize all prices to a total, his tekstbox i called "Tekst31". I would like the amount in this textbox to appear in a field "Bel�b" in the main form "Order".
I have tried some different commands, but nothing has worked, also I have made a query which dose the same ting as the tekstboks, as the information in that tekstbox it not stored anywhere.
I have a form which has a start date field & end date field i have a query that works out how many days from start date to end date that excludes weekends now my boss wants it to exclude any holidays we may have such as bank holidays etc can any help me with this i think i need a module and a new table with all the holidays in it i am right or iam i going crazy?
I have one form field with users total sum of lenght of service (format of field looks like yy/mm/ddd) in another form field I have data with users date of employment in a firm. In the third field I want to show total sum of lenght of service (previouse lenght of service and lenght of service in our firm) in format like in first field yy/mm/ddd.
What is a easiest way to calculate a third field in a form.
Hi, I have a table that has a start date field, a duration field and an end date field. I was wondering what I need to do so that the end date is calculated and entered when the duration is added onto the start date to produce the end date?
Should the date fields be set as a date, data type?
In my tables i currently have a start date for each employee, in my query i need to single out those who fall after 3rd september 2007, providing a yes/no answer.
Here is the scenerio: I have two tables: tblDate: Contains on Months (i.e.Jan, Feb, Mar, etc) tblActivities: Contains 4 fields Name, date, activity and hours
I have greated a form that allows me to select what month I want to see. It has a simple combo box in it that point back to tblDate.date. I setup a macro that is doing a OpenReport, there Where Clause is as follows: [Forms]![frmMnthSelect]![Combo0] Like [tblVolunteers]![Date]
Of course this is not working, and I am at a loss.
I have a Query that is setup that is pulling all records for the current month, but I need to be able to select individual months, because I often have to pull reports for past and future projects.
Can some one start me out in the right direction......
Hrmm, im sure there used to be an Excel forum, i seem to have lost it :/ Hope its ok posting here:
What im trying to do is, for a range of dates from 1/1/2005 to 31/12/2020 get the Qtrly Financial Period before...
So, for instance:
A date of 1/1/2005 makes the period before 1/10/2004 to 31/12/2005 A date of 1/5/2005 makes the period before 1/1/2005 to 31/3/2005 A date of 1/8/2010 makes the period before 1/4/2010 to 30/6/2010
Fiscal Period (for those that dont work with them) are, 1st April to 30th June, 1st July to 30th Sept, 1st Oct to 31st Dec and 1st Jan to 31st March of any year.
So what i want is 3 colums in excel, Column 1 = Period Start, Column 2 = Period End, Column 3 = Date
Can anyone figure the forumla out? Doesnt matter where its done in, just as long as the end result can be in Excel....
My query selects all those who donated to a fund.The max on the date restricts all but their last donation, working fine.But now I want to list all those who have not donated anything in the last x days (user defined). I want to use Date()- dateField>30 but now it does not let me peform the query. Any way I can do this in just one query? Thanks!
SELECT main.dgTitle, main.dgInit, main.dgSurname, main.dgNo, main.dgStreet, main.dgShul, Max(main.dgDate) AS maxdate FROM main WHERE (((Date()-[main].[dgdate])>30)) GROUP BY main.dgTitle, main.dgInit, main.dgSurname, main.dgNo, main.dgStreet, main.dgShul;
I'm having trouble getting my head around this. I have a database that collects stats of patients admitted to ICU. I have a table PtDataTable (pk = PtID) with a one to many relationship with PtVisitTable (pk = VisitID, fk = PtID). The patient visit table has the fields AdmissionDate and AdmissionTime, and DischargeDate and DischargeTime. I need to calculate if the patient is readmitted to ICU in less than or equal to 48hrs. In other words calculate the time elapsed between DischargedDate and DischargedTime in one record and the AdmissionDate and AdmissionTime for other records in the PtVisitTable for the same patient. I'm not sure if I stated this clearly. Any help is appreciated as always.
First I'm calculating the current Years of Service. SIV Date = Hired Date
Then I would like to calculate the years of service as of 12/31/"Current Year", where the Current Year would not require updating every year and 12/31 would be constant.
I'm just not sure how to specify the Month/Day and use Current Year not hard coded. I could set up a user defined date for that half of the calc but my users are not really bright and allowing them to simply click a button is my only option there.
Ultimately I will compare the 2 years of Service numbers to determine if there will be a change in the level of vacation accrual an individual receives during the year. The only part I have issue with is coding that date. Thanks for the help.
Hi I have a database for maintaining procurement contracts which includes a start date for each contract and a frequency of reviews required (monthly, qrtly, bi-annual, yearly). I need to be able to generate a report that will tell me when the next review is due for each contract, taking today's date into consideration.
This is the setup so far:
tblRegistry - contains field 'Commence' for the start date of the contract and 'Review Req' to indicate how often a review is required (monthly, yearly etc).
tblReviewReq - contains field 'Review Frequency' (monthly, yearly etc) and 'Days' to assign the number of days eg monthly = 30, yearly = 365 etc.
Next I have a query that includes the above tables using the fields 'Commence' and 'Days' and have created a calculated field to give me the next review date ie contract start is 1/08/07, review freq is monthly (=30 days), therefore the next review is 1/09/07. "NextReview:[Commence]+[Days]"
But how do I get it to tell me the next review date after the 1/09/07? Ultimately I'd like to be able to pull a report at any stage which will tell me all the reviews that are coming up.
Table ------ I have one field called [Time] in dd-mm-yyyy hh:mm format in table A.
I have another field called [Deadline] in text format (Mon 10:00) in table B.
Queries ------- Need to build one queries that have the above two field, but with additional field called [PullDeadline] that the [Time] will look out the [Deadline] and return the actual time & date value in [PullDeadline]. No matter how the [Time] change, the [PullDeadline] will stick to [Deadline] and return the value in that particular week.
For example,
[Time] = 01-12-2007 05:00:00 AM [Deadline] = Mon 10:00 [PullDeadline] = 26-11-2007 10:00 AM
How to handle, if the deadline is previous or next week?
Eg. [Deadline] = Sun 10:00
Then [PullDeadline] = 25-11-2007 10:00 AM instead of 02-12-2007 10:00 AM.
I need to use an update query to calculate the following 1st of April for each of 3000+ records, the only exception is if the Start Date is the 1st of April in which case the date will remain the same.
I have the following date calculation : ----------------- Private Sub StatofLimits_GotFocus() '--Determines Statute of Limitations accounting for minors. If DateAdd("yyyy", 18, Me.Txt14) > Me.txtBegin Then Me.StatofLimits = DateAdd("yyyy", 20, Me.Txt14) Else Me.StatofLimits = DateAdd("yyyy", 2, Me.txtBegin) End If End Sub ------------------------ Here is my problem. The number "2" in the else statement (Me.StatofLimits = DateAdd("yyyy", 2, Me.txtBegin)in the above example is a variable. The variable is selected from a combobox and stored in an unbound textbox. The variable will always represent a number of years-ie 3 years, 4 years, etc. I need to modify my calculation so that it will pull the variable from my textbox: I know this isn't correct but this is what I need:
Me.StatofLimits = DateAdd("yyyy", (Number from MyTxtBox), Me.txtBegin)
Can anyone give me the correct syntext?
Pat, If you read this, I did listen. The reason I need to modify my calculation and use a variable is because I moved my Statute of Limitation Dates to the same table and different case types have different Statutes. They can be anywhere from 2 to 6 years.
I am not sure how to do the following and appreciate any help offered.
I need to have create an expression that gives me a total based on the number of days (different arrival and departure dates) where each day has a different value but remains the same from record to record. Perhaps this is a very easy thing to do, but I am just missing it.
OK so I have a form with the following fields which are all date/time type apptTime timerOn pickupDate reminder - combo box with 1 hour, 2 hour...etc up to 10 hours
so what happens is when user enters apptTime say 18:30 with pickupDate set for current days date 10/14/2006 then chooses 2 hours from the reminder combo. This then sets timerOn to (apptTime-2 hours) so it is 16:30. I have set a conditional formatting to change background color when "timerOn<=Time() and pickupDate=Date()" so user knows to dispatch this load. This all works great until you get to midnight. If user sets apptTime to 00:30 with pickupDate to 10/15/2006 and chooses 2 hour reminder, so timerOn does get set to 22:30 and you would expect the conditional formatting to work once the current Time() is 22:30, but since the current Date() is 10/14/2006, the expression is false. I have tried the DateAdd such as DateAdd("d", 1, Date()) command in various ways but can't get it to work for "timerOn<=Time() and pickupDate=DateAdd("d", 1, Date())"...I mean it works because it adds 1 day to pickupDate and condition is then true, but it ignores the timerOn<=Time() part and formats even if I reset system time to 22:29. Can anybody give me insite on where the logic is wrong?
Must admit I have always had problems getting my mind around the Nz function and where to stick it in an expression. have googled this one (as I know it is not a common problem) but to no avail
If i have a calculated field
=DateAdd("d",7,[DateSubmitted]) then how do I deal with the possibility that [DateSubmitted] may be blank??
I am looking to calculate in a form someones age in years and months at a specific date.
I have tried various different functions but can't seem to work out where i'm going wrong.
The persons date of birth is entered manually into the "DoB" field. I then want their age to be calculated in a text box below this, if it needs 2 text boxes then so be it.
The specific date is 25/05/2007 (UK date).
I am currently using the datediff function but I need the calc to be more specific than just the year.
I am developing a small application for a school. In the school they teach 5 subjects in five periods. One period's time in 40 minutes. I want to develop a table which will display the next period after previous period is over. The computer must skip to next period on the basis on system time.
Hi, I have a membership database I'm working on and the problem I'm tearing what's left of my hair out over is this:
If the date of joining the club is <= 15th of that month then the renewal date is 1st of that same month in the following year.
However, if the date of joining the club is >15th of that month then the renewal date is 1st of the following month in the following year.
I hope that makes sense/ Example:
JoinDate = 03/08/06 then RenewalDate = 01/08/07
BUT IF
JoinDate = 16/08/06 then RenewalDate = 01/09/07
Any ideas on how I would go about doing this would be greatly appreciated.
I realise that I could simply use the DatAdd() function to add an entire year to the JoinDate, but as you see the criteria I have to work to is unfortunately not that simple.:(