I use in my project VB.NET with sqlserver2000 and Crystalreports.NET,ofcourse.
I have big problems in calculation of the time of work.
I will try to explain in my bad english...I hope that someone will understand what I mean.
I have a formula where I calculated time where I display time when begin and ends work in a normal day of work.
The pause time is between 10:00 - 10:25 (for breakfast...for example) and 13:00-13:20 (for lunch)
Sometimes it happens that a worker doesn't take his pause,so I must check to see if the worker doesn't take his pause and try to calculate his hours of work.
What I make until now is:
Calculate minutes of work in a day:
@minutes of work
\\calcul of minutes for lunch pause
local datetimeVar p3:=Cdatetime("13:00");
local datetimeVar p4:=Cdatetime("13:20");
local numbervar mittag:=DateDiff ("n", p3, p4);
\\calcul of minutes for breakfast pause
local datetimeVar p1:=Cdatetime("10:00");
local datetimeVar p2:=Cdatetime("10:25");
local numbervar freuh:=DateDiff ("n", p1, p2);
\\calcul of a normal work day
local dateTimeVar d1 := {@HourBeg};\\when StartHour begins
local dateTimeVar d2 := {@HourEnd};\\when EndHour ends
local numbervar normal:=DateDiff ("n", d1, d2);
\\I try to put the time values for pausen in a array
datetimevar array Pausen:=[ p1,p2,p3,p4];
if d2=Cdatetime(0,0,0) then 0
else
if tonumber({PAUSEN.FRUEHNICHTGEMACHT})=1 and (d1 in p1 to p2) then normal - freuh
else
normal;
This is not ok.I need to check if time for breakfast pause,for example there is between @Hourbeg to @HourEnd.
An example:
if he work between 08:00-11:00 and he take his pause then his time of work is 180 minutes-25minutes=155 minutes.
Thanks in advance for any kind of help!
I have big problems in calculation of the time of work.
I will try to explain in my bad english...I hope that someone will understand what I mean.
I have a formula where I calculated time where I display time when begin and ends work in a normal day of work.
The pause time is between 10:00 - 10:25 (for breakfast...for example) and 13:00-13:20 (for lunch)
Sometimes it happens that a worker doesn't take his pause,so I must check to see if the worker doesn't take his pause and try to calculate his hours of work.
What I make until now is:
Calculate minutes of work in a day:
@minutes of work
\\calcul of minutes for lunch pause
local datetimeVar p3:=Cdatetime("13:00");
local datetimeVar p4:=Cdatetime("13:20");
local numbervar mittag:=DateDiff ("n", p3, p4);
\\calcul of minutes for breakfast pause
local datetimeVar p1:=Cdatetime("10:00");
local datetimeVar p2:=Cdatetime("10:25");
local numbervar freuh:=DateDiff ("n", p1, p2);
\\calcul of a normal work day
local dateTimeVar d1 := {@HourBeg};\\when StartHour begins
local dateTimeVar d2 := {@HourEnd};\\when EndHour ends
local numbervar normal:=DateDiff ("n", d1, d2);
\\I try to put the time values for pausen in a array
datetimevar array Pausen:=[ p1,p2,p3,p4];
if d2=Cdatetime(0,0,0) then 0
else
if tonumber({PAUSEN.FRUEHNICHTGEMACHT})=1 and (d1 in p1 to p2) then normal - freuh
else
normal;
This is not ok.I need to check if time for breakfast pause,for example there is between @Hourbeg to @HourEnd.
An example:
if he work between 08:00-11:00 and he take his pause then his time of work is 180 minutes-25minutes=155 minutes.
Thanks in advance for any kind of help!