Date and Time Help

stu_c

Registered User.
Local time
Today, 23:21
Joined
Sep 20, 2007
Messages
494
Hi all
I have a table with the following fields
DateReported - (Auto insert Date and Time, eg 21/06/2013 10:27:15)
ResponceTime - (Either 4 hours, 27 hours, 7 Days)
OutBy - (DateReported + ResponceTime)

I am trying to work out how to get the ResponceTime to work and OutBy is automatically calculated from DateReported for example

if DateReported is 21/06/2013 10:27:15, and the ResponceTime is 4 hours then the OutBy is 21/06/2013 14:27:15.

again if DateReported is 21/06/2013 10:27:15, and the ResponceTime is 7 days hours then the OutBy is 28/06/2013 14:27:15hope you can help
 
Last edited:
If you want to add time to a date use DateAdd - for example OutBy = DateAdd("d",4,DateReported) will add 4 days to DateReported giving OutBy or you could use DateAdd("d",ResponseTime,DateReported).
 
If you want to add time to a date use DateAdd - for example OutBy = DateAdd("d",4,DateReported) will add 4 days to DateReported giving OutBy or you could use DateAdd("d",ResponseTime,DateReported).

I tried the following in my query but kept coming up with the parameter query instead.

as per my post I want to add the ResponceTime To the DateReported, but just not too sure exactly how to do it :(
 
I think what you need is a standardized input in the Response time field.. You should either get everything to Minutes or Hours or Days.. Having three different formats will cause the troubles.. As you can see, DateAdd takes in different arguments.. On a side note, you can write a function to determine the result..
 
Last edited:
I think what you need is a standardized input in the Response time field.. You should either get everything to Minutes or Hours or Days.. Having three different formats will cause the troubles.. As you can see, DateDiff takes in different arguments.. On a side note, you can write a function to determine the result..

ok I have got an idea then
I will have the following
4 hours
24 hours
168 Hours

whats the best way to to get the DateReported + ResponceTime = OutBy?
 
the Query would look like..
Code:
SELECT DateReported, ResponceTime, DateAdd("h", [ResponceTime], [DateReported]) AS OutBy 
FROM yourTable;
 
I have worked out 4 hours in a day is 0.16666666666

what I am going to do is have a drop down wizard list so the user can click on the appopiate date.

I will have two colums CallOutTime and ActualTime, the data will then be read form column 2 but only shows column one in the form :)
 
You can do that.. but also, you can use the AfterUpdate of the UNBOUND ComboBox to calculate the information and store the ActualValue in the table..
 

Users who are viewing this thread

Back
Top Bottom