PC Review


Reply
Thread Tools Rate Thread

calculation based on time

 
 
=?Utf-8?B?am9y?=
Guest
Posts: n/a
 
      21st Jul 2007
i tried this on my database to calculate the difference between onblock and
offblock but i got "00:00: answer. I am using QUERY to calculate the time.
on my table the onblock and offblock was formated as SHORT TIME.

DateDiff("n",Format([onblock],"Short Time"),Format([offblock],"Short Time"))

Please help. . .
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      21st Jul 2007
Drop the Format(). The function outputs the Text type, which then has to be
converted back into Date/Time type, and there's opportunities for errors.

Just use:
DateDiff("n", [onblock], [offblock])

This might also help:
Calculating elapsed time
at:
http://allenbrowne.com/casu-13.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"jor" <(E-Mail Removed)> wrote in message
news:1FA41571-64FA-4693-AB84-(E-Mail Removed)...
>i tried this on my database to calculate the difference between onblock and
> offblock but i got "00:00: answer. I am using QUERY to calculate the
> time.
> on my table the onblock and offblock was formated as SHORT TIME.
>
> DateDiff("n",Format([onblock],"Short Time"),Format([offblock],"Short
> Time"))
>
> Please help. . .


 
Reply With Quote
 
=?Utf-8?B?am9y?=
Guest
Posts: n/a
 
      31st Aug 2007
Thanks allen.

"Allen Browne" wrote:

> Drop the Format(). The function outputs the Text type, which then has to be
> converted back into Date/Time type, and there's opportunities for errors.
>
> Just use:
> DateDiff("n", [onblock], [offblock])
>
> This might also help:
> Calculating elapsed time
> at:
> http://allenbrowne.com/casu-13.html
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "jor" <(E-Mail Removed)> wrote in message
> news:1FA41571-64FA-4693-AB84-(E-Mail Removed)...
> >i tried this on my database to calculate the difference between onblock and
> > offblock but i got "00:00: answer. I am using QUERY to calculate the
> > time.
> > on my table the onblock and offblock was formated as SHORT TIME.
> >
> > DateDiff("n",Format([onblock],"Short Time"),Format([offblock],"Short
> > Time"))
> >
> > Please help. . .

>
>

 
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
Complex Time Window / date based calculation stef Microsoft Excel Discussion 1 10th Sep 2007 08:10 PM
Complex Time Window / date based calculation stef Microsoft Excel Worksheet Functions 0 10th Sep 2007 08:06 PM
Calculating Minutes from and Time Based Calculation =?Utf-8?B?RG9u?= Microsoft Excel Worksheet Functions 4 27th Nov 2006 11:49 PM
Calculation based on another calculation T Smith Microsoft Access Forms 3 8th Jan 2004 12:04 AM
Re: Time calculation based on filled information cabarle Microsoft Excel Programming 1 5th Sep 2003 08:12 PM


Features
 

Advertising
 

Newsgroups
 


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