Solved DateDiff to calculated min

Alvein17

New member
Local time
Tomorrow, 03:57
Joined
Sep 2, 2021
Messages
29
Dear All,

hello i need some advice to fix my trouble.
i have a table, there is CuciMesinStart, CuciMesinEnd and Column A as a Calculated result from CuciMesinEnd - CuciMesinStart. with condition Shift 3, it's mean start from 11:00 PM until 07:00 AM.
so my question how to get a result from CuciMesinEnd-CuciMesinStart
1631242567334.png


this is my querry.

1631242918848.png
 
Hi. Not sure I understand your question. Can you maybe post some mockup using Excel to show the current data and the result you from them? Thanks.
 
Code:
A: IIf(TimeValue([CuciMesinEnd])<TimeValue([CuciMesinStart]),
DateDiff("n",[CuciMesinStart],DateAdd("d",1,[CuciMesinEnd])),
DateDiff("n",[CuciMesinStart],[CuciMesinEnd]))\60 & ":" &
(IIf(TimeValue([CuciMesinEnd])<TimeValue([CuciMesinStart]),
DateDiff("n",[CuciMesinStart],DateAdd("d",1,[CuciMesinEnd])),
DateDiff("n",[CuciMesinStart],[CuciMesinEnd])) Mod 60)
 
1631247805993.png

Hi. Not sure I understand your question. Can you maybe post some mockup using Excel to show the current data and the result you from them? Thanks.
hello, this i attached mockup by excel file. actually i have do it by excel, but when i move to Access querry i got some toruble with this.
 
Code:
A: IIf(IsNull([CuciMesinStart]+[CuciMesinEnd]),
0,
DateDiff("n",CDate(Date() & " " & [CuciMesinStart]),
CDate(Date()-([cuciMesinStart]>[CuciMesinEnd]) & " " & [CuciMesinEnd])))
 
Code:
A: IIf(TimeValue([CuciMesinEnd])<TimeValue([CuciMesinStart]),
DateDiff("n",[CuciMesinStart],DateAdd("d",1,[CuciMesinEnd])),
DateDiff("n",[CuciMesinStart],[CuciMesinEnd]))\60 & ":" &
(IIf(TimeValue([CuciMesinEnd])<TimeValue([CuciMesinStart]),
DateDiff("n",[CuciMesinStart],DateAdd("d",1,[CuciMesinEnd])),
DateDiff("n",[CuciMesinStart],[CuciMesinEnd])) Mod 60)
Hello Arnelg, thank you for your help. it's work so well.
 

Users who are viewing this thread

Back
Top Bottom