DateDiff using multiple controls....hhheeelllppp PLEASE. 
Author Message
 DateDiff using multiple controls....hhheeelllppp PLEASE.

Ronnie,

How's this:

First, put the date and times together.

StartDtTm = CDate(Format(StartDate,"d mmm yyyy") & " " & Format(StartTime,
"hh:nn"))
FinishDtTm = CDate(Format(FinishDate,"d mmm yyyy") & " " &
Format(FinishTime, "hh:nn"))

Get the difference in hours.

Hrs = DateDiff("h", StartDtTm, FinishDtTm)

Get the difference in days.

Dys = DateDiff("d", StartDtTm, FinishDtTm)

Subtract 12 hours for each day.

Hrs = Hrs - (Dys * 12)

Note that this is straight off the top of my head - untried, no guarantees.
Hope it helps.

Mark



Quote:
> I have four fields:
> StartTime
> StartDate
> FinishTime
> FinishDate

> I want to find out the hours and minutes it takes to finish something
after
> starting.

> My Problem:
> DateDiff seems to give back a result when using two fields.  I have four.

> Another Problem:
> I only want hours to run on an 8am - 8pm clock.  For example, if it took
> exactly 2 days to finish an event, the difference between Start and
Finish

> Can someone please help?  I am stuck and going crazy.

> Thank you to all those that attempt.



Fri, 14 Apr 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. DateDiff problem please help

2. Need help on datediff please

3. Multiple users using ADO and Access - please help

4. Using DateDiff to get decimal ages

5. Calculating Time Difference using DateDiff Function in VBScript

6. Using DateDiff to calculate differences in minutes

7. Using the DateDiff function

8. Using Datediff

9. vbscript newbie needs help using DateDiff - getting headache tryi ng to figure out logic

10. VBRUN300.dll crashes using DateDiff

11. Using DATEDIFF in Crystal Rpts 7.0

12. Using DateDiff

 

 
Powered by phpBB® Forum Software