function for to calculate night shift and hours currents

Hi, I need a function that calculates the daytime and nighttime hours within a shift, for example 16 hour of entry to 01 hour of departure of de next day, from 16 to 22 = 6 hours (daytime), and from 22 to 01 of the next morning = 3 hours (nighttime), total hours = 9 hours

thanks for all

Re: function for to calculate night shift and hours currents

Did you try to use Date data type variables?

Re: function for to calculate night shift and hours currents

Quote:

Originally Posted by

**VictorN**

yes, but I do not know much about programming, I do not know how to do it

Re: function for to calculate night shift and hours currents

Quote:

Originally Posted by

**juanfrasantos**
yes, but I do not know much about programming, I do not know how to do it

Then learn the programming!

And search for the reliable sample code!

Re: function for to calculate night shift and hours currents

i search but not find sample code about this, please help me, thanks

Re: function for to calculate night shift and hours currents

Have a look at the DateAdd() and DateDiff() functions