Re: subtract hours

Tech-Archive recommends: Speed Up your PC by fixing your registry



You would need to convert the text to a date. If your values were all less
than "24:00" then you could use CDate() or TimeValue(). Values greater than
23:59:59 would require a custom function or fancy expression.

--
Duane Hookom
MS Access MVP


"Wez.k" <Wezk@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9B3E484E-EC0A-4F6E-A28B-9B9DE4C10D9D@xxxxxxxxxxxxxxxx
> Text fields - is that the problem?
>
> "Duane Hookom" wrote:
>
>> Do you have date/time fields or are you attempting to do this with text
>> fields. Since you stated "26:00" I should have suspected text.
>>
>> --
>> Duane Hookom
>> MS Access MVP
>> --
>>
>> "Wez.k" <Wezk@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:2D55DDC0-23C2-424D-A103-D1068C3C2C33@xxxxxxxxxxxxxxxx
>> >I keep getting a Type Mismatch error
>> >
>> > "Duane Hookom" wrote:
>> >
>> >> That's basically what happens. Why do you think you aren't getting
>> >> correct
>> >> results? Do you have an example?
>> >>
>> >> Doug Steele has a nice function at
>> >> http://www.accessmvp.com/djsteele/Diff2Dates.html.
>> >>
>> >> --
>> >> Duane Hookom
>> >> MS Access MVP
>> >> --
>> >>
>> >> "Wez.k" <Wezk@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:37E317E7-BD77-4206-A518-B1106AA59E64@xxxxxxxxxxxxxxxx
>> >> > Hello
>> >> > Could anyone tell me a simple way to subtract two times to give the
>> >> > difference, i.e. subtract 22:40 from 26:00 to get 03:20.
>> >> > The values are held in text boxes on a report.
>> >> >
>> >> > Thanks
>> >>
>> >>
>> >>
>>
>>
>>


.



Relevant Pages

  • Re: subtract hours
    ... "Duane Hookom" wrote: ... > Do you have date/time fields or are you attempting to do this with text ... >>> MS Access MVP ... Prev by Date: ...
    (microsoft.public.access.reports)
  • Re: How do I group on first 10 characters in a date/time field in a qu
    ... You should refer to "characters" with date/time fields. ... Duane Hookom ... MS Access MVP ...
    (microsoft.public.access.queries)
  • Re: Date and Time
    ... Use DateValueto get the date portion of the value and TimeValue() to get ... only the time portion. ... Duane Hookom ... MS Access MVP ...
    (microsoft.public.access.queries)
  • Re: Beginner query help please
    ... MS Access MVP ... I've noticed that if you select all the query output (in this case ... Duane Hookom wrote: ... Controls in most query solutions would not be ignored. ...
    (microsoft.public.access.queries)
  • Re: Adding a ck mark?
    ... Duane Hookom ... MS Access MVP ... "txt1" is the name of a control in the detail section, ... Let's start a new report. ...
    (microsoft.public.access.reports)