Why The Result Show Like 00:00, Access 2007

Joined
Jan 22, 2016
Messages
3
Reaction score
0
Hi All,

I have 5 textboxs:

1. startTime
2. startDate
3. endTime
4. endDate
5. TimeDiff (short time format)

i use these code in the TimeDiff textbox in the control source : =DateDiff("n";[FStartTime]+[FStartDate];[FEndTime]+[FEndDate]) , after i enter the first four entries, in the TimeDiff textbox the result appear to me as 00:00 and the result didn't save in the table, why the result appear to me as 00:00 and why it's didn't save in the table.

please help

Regards
 
Joined
Oct 25, 2016
Messages
2
Reaction score
2
Hi. The post is quite old, but I hope this will help somebody with similar issue. I see the problem here is that DateDiff("n",...) return integer that corresponds to number of minutes in the difference between two dates. It must be converted into minutes and seconds as follows:

Int(DateDiff("n",[FStartTime]+[FStartDate];[FEndTime]+[FEndDate])/60) & ":" & Format(DateDiff("n",[FStartTime]+[FStartDate];[FEndTime]+[FEndDate]) Mod 60, "00")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top