PC Review


Reply
Thread Tools Rate Thread

Calculating time

 
 
Dave
Guest
Posts: n/a
 
      3rd Jun 2010
I have a single table database that has a drop down box of 60 days, 90 days,
and 180 days.

I want to calculate to time from the date of entry in the database to count
down from the days that was selected in the drop down box.

How would I go about doing this please be detailed and if you can include a
simple of the code that I would need in order to complete the task.
 
Reply With Quote
 
 
 
 
Jörn Bosse
Guest
Posts: n/a
 
      3rd Jun 2010
Am 03.06.2010 21:23, schrieb Dave:
> I have a single table database that has a drop down box of 60 days, 90 days,
> and 180 days.
>
> I want to calculate to time from the date of entry in the database to count
> down from the days that was selected in the drop down box.
>
> How would I go about doing this please be detailed and if you can include a
> simple of the code that I would need in order to complete the task.


Hi,

if you want to do so, you could use the DateAdd-Function.
I would use it in a query.
You have the fields: Date1,Interval,Date2 in your table1

And the query hast to look like this:
SELECT Table1.Date1, Table1.Interval,
DateAdd('d',table1.Interval,table1.Date2) AS Date2
FROM Tabelle1;

The 'd' is for the intervaltype - d for day
The 2nd operator is the intervall, hier you have to select your values
from the combo box
The last operator is the startdate.

Regards
Jörn


 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      3rd Jun 2010
On Thu, 3 Jun 2010 12:23:06 -0700, Dave <(E-Mail Removed)>
wrote:

>I have a single table database that has a drop down box of 60 days, 90 days,
>and 180 days.
>
>I want to calculate to time from the date of entry in the database to count
>down from the days that was selected in the drop down box.
>
>How would I go about doing this please be detailed and if you can include a
>simple of the code that I would need in order to complete the task.


I suspect you'll use the DateDiff() function - press Ctrl-G to open the VBA
editor (to connect to the right Help file) and search for Help on DateDiff.

It's not clear to men what you mean by "count down". Do you want to calculate
the date 60 (or 90 or 180) days after the date in a date/time field in the
table? If so a Query with a calculated field

CountDownDate: DateAdd("d", [Forms]![YourForm]![YourDropdownBox], [datefield])

will do the job. If that's not what you want please post an explanation or an
example.
--

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating Time with Date/Time checking in formula cmatera Microsoft Excel Worksheet Functions 2 11th Aug 2008 01:38 PM
Re: Daylight Saving Time (DST) and calculating time difference. Peter T Microsoft Excel Programming 3 19th Jan 2007 10:51 AM
Re: Daylight Saving Time (DST) and calculating time difference. Chip Pearson Microsoft Excel Programming 1 17th Jan 2007 03:35 PM
calculating timesheet, time-in/time-out = total hours & minutes, . =?Utf-8?B?U3RldmUgTGluZHNheQ==?= Microsoft Excel Worksheet Functions 13 8th Nov 2006 03:45 PM
Calculating effective time from start/end date+time Stefan Stridh Microsoft Excel Worksheet Functions 8 27th Nov 2004 03:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:56 AM.