"Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message
news:UPmdnYb7hO DWB4vdRVn-uA@comcast.com. ..[color=blue][color=green]
> > How do I add 1:45 to 1:45 to get 3:00[/color]
>
> You can't... those two times add to 3:30, not 3:00.<g>[/color]
Well, to be truthful, you *can*... :) Just use your code, but add and If
statement to look and see if Time1 and Time2 equals "1:45" then set the
final answer to "3:00". Viola! He didn't ask how to make it correctly add
the times together, just to make those two times come out to 3:00. You
gotta go by command specs and do what they say. Never assume anything. Do
exactly what they say *or* ask first, then code it. :-D
[color=blue]
> As long as the total won't go over 24 hours,[/color]
Time1 = "1:45"
Time2 = "1:45"
if Time1 = "1:45" and Time2 = "1:45" then ' Those sneaky design specs.
MsgBox "3:00" ' Why would they want this value from those?
else
Msgbox Format(CDbl(CDa te(Time1) + CDate(Time2)), "h:mm")
end if
[color=blue]
> Rick - MVP
>[/color]
t = #1:45:00 AM#
t = DateAdd("h", 1, t)
t = DateAdd("n", 45, t)
Answer= 3:30
"Dillon Mantle" <dillonm@dasolu tions.co.za> wrote in message
news:H_adnciTPb ZHCovdRVn-ug@is.co.za...[color=blue]
>
> Hi
>
> How do I add 1:45 to 1:45 to get 3:00
>
> Regards
> Dillon Mantle
>
>[/color]
Comment