Viewing 7 posts - 1 through 7 (of 7 total)
select dbo.CalcTimeBetweenTwoDates(getdate()-1,getdate())
your new code without any changes by me returns 8.5 hours instead of the 8 hours.
January 4, 2008 at 8:54 am
Hello again, Mazharuddin Ehsan
Ok, that works but it still have a problem if i put the end date in an holiday:
select dbo.ufninc_CalcTimeSinceCreated(convert(datetime,'26-12-2007',105),convert(datetime,'1-1-2008',105))
Best Regards
January 3, 2008 at 4:24 pm
DataAMeiaNoite = dateatmidnight
DataInicioTrab= dateAt730
DataAlmocoInicio = dateAt1130
DataAlmocoFim= dateAt12
DataFIMTrab = dateAt16
DataInicio= startDate
DataFim= endDate
[font="System"]
ALTER function [dbo].[ufninc_CalcTimeSinceCreated](@DataInicio DateTime,@DataFim DateTime)
returns real
as
begin
declare @CalcHours real
declare @VarCalcCreateDate datetime
if dbo.ufninc_DataAMeiaNoite(dbo.ufninc_CalcCreateDate(@DataInicio)) = dbo.ufninc_DataAMeiaNoite(dbo.ufninc_CalcGetDate(@DataFim))
set...
January 3, 2008 at 6:21 am
it's good to have such a big lunch time!
I'm having another problem, when i make
select dbo.CalcTimeSinceCreated(convert(datetime,'31-12-2007',105),convert(datetime,'02-01-2008',105))
And i've an holiday in my database for the date (01-01-2008),
it goes to a...
January 3, 2008 at 4:15 am
you where right! tnx for the answer and for the short waiting time!
I changed 1800s to 5400s that is my lunch time, and the code work just like it should!
best...
December 28, 2007 at 9:26 am
Hello again, tnx for the answer!
I've now another problem, since i have to recalcute all the history of my service desk to show in a report, i've to change your...
December 28, 2007 at 7:54 am
Your work is working perfect on a calculation of SLA for my service desk.
I would like to know if it is possible to include holidays e the calculation.
December 27, 2007 at 4:40 am
Viewing 7 posts - 1 through 7 (of 7 total)