February 1, 2013 at 5:37 am
Hi i need to calculate the TAT in my application. i am having date like this :
InTime OutTime
12/17/2012 8:40:00 PM12/18/2012 7:40:00 AM
If Intime is <= 9 PM (then the TAT need to <=8 AM EST for the following business day) - MET OR NOT MET
12/17/2012 9:40:00 PM12/18/20129:40:00 AM
If Intime is >= 9 PM (then the TAT need to <=9 PM EST for the second business day - MET OR NOT MET
Please Help me and give some ideas.
February 1, 2013 at 9:00 am
Kasinathan (2/1/2013)
Hi i need to calculate the TAT in my application. i am having date like this :InTime OutTime
12/17/2012 8:40:00 PM12/18/2012 7:40:00 AM
If Intime is <= 9 PM (then the TAT need to <=8 AM EST for the following business day) - MET OR NOT MET
12/17/2012 9:40:00 PM12/18/20129:40:00 AM
If Intime is >= 9 PM (then the TAT need to <=9 PM EST for the second business day - MET OR NOT MET
Please Help me and give some ideas.
Hi it seems you are pretty new around here. Your description is entirely to vague for anybody to help much. Please take a few minutes to read the article found at the first link in my signature about best practices when posting questions.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
February 1, 2013 at 9:11 am
Sean Lange
Hi it seems you are pretty new around here. Your description is entirely to vague for anybody to help much. Please take a few minutes to read the article found at the first link in my signature about best practices when posting questions
Not to diminish Sean Lange's comment - but your request
Please Help me and give some ideas.
.
Here is an idea, NOT a solution, but an idea as you requested.
DECLARE @In DATETIME
DECLARE @InHr DATETIME
DECLARE @Out DATETIME
SET @In = '12/17/2012 9:40:00 PM'
SET @Out = '12/18/2012 7:40:00 AM'
SELECT DATEPART(hh,@In) AS 'Hour in',DATEPART(dd,@In)AS 'Day in',DATEPART(hh,@Out) AS 'Hour out',DATEPART(dd,@Out)AS 'Day out'
IF DATEPART(hh,@In) > DATEPART(hh,@Out) AND (DATEPART(dd,@In) = DATEPART(dd,@Out)-1)
PRINT 'do something'
ELSE
PRINT 'Do NOTHING'
February 1, 2013 at 6:35 pm
Kasinathan (2/1/2013)
Hi i need to calculate the TAT in my application.
Heh... I hate to ask. What's a "TAT"?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply