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've read through the forums on saving the results of a calculation into a field is a bad idea. I somewhat understand the reasoning for it. But I don't think such situations arise for everyone.
But I have gone with the suggestion and created an updatequery, which simply goes through and updates the calculated value into a table. Now each time the updatequery is run its asking for permission as to the fact if I'm sure I want it to be run. How do I turn this option off. And should I call this updatequery afterupdate or beforeupdate?
We have a date function that converts a text date format. Can someone help me with time function to do the same thing? We want military time. The field is like this now: txt fields. 160037 213137 224356 235716 235800 12341 21708 22732 Here is the date function we use: Function f2Date(strDateOld As String) Dim strDate As String, strMonth As String, strYear As String strMonth = Mid(strDateOld, 5, 2) strDate = Right(strDateOld, 2) strYear = Left(strDateOld, 4) f2Date = strMonth & "-" & strDate & "-" & strYear f2Date = CDate(f2Date) f2Date = Format(f2Date, "mmmm d yyyy") End Function
I need a little help. In my DB, I have a command button set up (I was tired of typing in dates) for date, but I used the Now function, which also gives me the time.
Now I have over 3000 subrecords of the main ones. I now need to queries transaction for that specific date, but it also retrieves the time.
I tried to go back and change the NOW to DATE in VB, but the code does not run.
How do I change all records that have date and time (using NOW function) and only click that command button to show only the date (mm/dd/yyyy)?
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?
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.