Devam Ediyor

SQL 2000 Function DueDate Calculator

I Want an SQL 2000 function , that calculate date like this

Call Date 08/01/2006 - dd/mm/yyyy

Staff working in time = [url removed, login to view]

Staff end of work time = [url removed, login to view]

Must solve within(prioritytime) = 3hours(240minutes) must calculate in minutes

A customer log a call at 08/01/2006 15.31 and this call should be resolved within 3(240minutes) hours of recieving the call therefore the call should be resolved before

or at

09/01/2006 - [url removed, login to view]

Being that End of work time - Call time = 2hrs remaining 1 hr, 1 sec

then add 1 hr, 1 sec to the start of working day tommorrow which is

09/01/2006 - [url removed, login to view]

This Function should avoid weekend appropriately and Holidays eg (which must me check from a Test Holiday Table u designed )

- I have given u the code to give u a head start

SAMPLES and expected output

select [url removed, login to view]('08/01/2007 10:00:00',240)

08/01/2007 13:00

select [url removed, login to view]('08/01/2007 14:00:00',240)

08/01/2007 17:00

select [url removed, login to view]('08/01/2007 14:30:00',240)

08/01/2007 17:30

select [url removed, login to view]('08/01/2007 15:00:00',240)

09/01/2007 09:30

select [url removed, login to view]('08/01/2007 17:00:00',240) WATCH THE DATE

09/01/2007 11:30

select [url removed, login to view]('08/01/2007 19:00:00',240) WATCH THE DATE

09/01/2007 12:00

select [url removed, login to view]('08/01/2007 08:00:00',240) WATCH THE DATE

09/01/2007 12:00

select [url removed, login to view]('08/01/2007 23:10:00',240) WATCH THE DATE

09/01/2007 12:00

select [url removed, login to view]('08/01/2007 08:59:02',240) WATCH THE DATE

09/01/2007 12:00

select [url removed, login to view]('08/01/2007 09:01:00',240) WATCH THE DATE

09/01/2007 12:01

select [url removed, login to view]('08/01/2007 09:05:00',510) 5hrs 30minutes WATCH THE DATE

09/01/2007 09:05

Note PriorityTime Can be 10minutes, 1hr(60minutes), 24hrs(1440minutes), 14days(20160minutes), 30days(43200minutes) - hence must handle

any minute - Must work with minutes

Pls debug before confirming, no spaghetti code - pls as I will test it very well

IF YOU DON'T UNDERSTAND THE QUESTION PLS DON'T BID,

MY DEADLINE IS SUNDAY MIDNIGHT 7TH JAN 2006

CREATE Function [url removed, login to view] (@PaymentDateEx datetime)

RETURNS datetime

AS

begin

DECLARE @WhichDay varchar(44)

SET @WhichDay = DATENAME(DW,@PaymentDateEx)

IF @WhichDay = 'Saturday'

BEGIN

SET @PaymentDateEx = @PaymentDateEx +2

END

IF @WhichDay = 'Sunday'

BEGIN

SET @PaymentDateEx = @PaymentDateEx +1

END

return @PaymentDateEx

end

Beceriler: .NET, C Programlama, Java, Javascript, Betik Yükleme

Daha fazlasını görün: date calculator sql, sql date calculator, sql date calculations, sql date calculate, sql 2000 holidays, date calculation sql, calculate due date sql, weekend work, table customer, call minutes, duedate sql time, calculator function, sql date birth calculator, calculate due date java, sql due date calculate, calculate due date excluding holidays weekends sql, calculating due date sql, due date calculator 2006, sql calculation minutes, sql user function calculate budget date, using system date calc sql, project due date calculator, function calculate date, select function sql 2000, calc work time sql

İşveren Hakkında:
( 25 değerlendirme ) London, United Kingdom

Proje NO: #117300