Click here to Skip to main content
15,885,914 members
Home / Discussions / Database
   

Database

 
QuestionDatabase Design Pin
Gjm8-Jan-10 2:14
Gjm8-Jan-10 2:14 
AnswerRe: Database Design Pin
dan!sh 8-Jan-10 3:06
professional dan!sh 8-Jan-10 3:06 
AnswerRe: Database Design Pin
riced8-Jan-10 5:56
riced8-Jan-10 5:56 
GeneralRe: Database Design Pin
Gjm8-Jan-10 14:43
Gjm8-Jan-10 14:43 
QuestionEXEC Return Value Pin
dataminers7-Jan-10 7:05
dataminers7-Jan-10 7:05 
AnswerRe: EXEC Return Value Pin
Eddy Vluggen7-Jan-10 8:57
professionalEddy Vluggen7-Jan-10 8:57 
AnswerRe: EXEC Return Value Pin
Dimitri Witkowski7-Jan-10 8:59
Dimitri Witkowski7-Jan-10 8:59 
QuestionProblem in Finding Hours Duration Between two Dates Pin
Vishnu Narayan Mishra7-Jan-10 3:03
Vishnu Narayan Mishra7-Jan-10 3:03 
Hi to All Forum members


I am stuck in finding duration and Net duration in the following procedure


I also adding image Url for better under standing of my requirement.

Please go to this Url ..

http://picasaweb.google.com/lh/photo/203UnHt9l8EnouLOtIKxBg?authkey=Gv1sRgCM6puf-sutfJ2QE&feat=directlink[^]


Following is my T-Sql Query...


Select F.Id as [FleetID], Convert(varchar(30), F.AssignedOn, 113) as [Date], D.DepotName as [Depot], DT.DutyID as [Duty Number],
IsNull(Convert(varchar(30), F.ActualOutSheddingTime, 113),'Not Assigned') as [Actual OutShedding Time],
IsNull(Convert(varchar(30), F.ActualInsheddingTime, 113) ,'Not Assigned') as [Actual Inshedding Time],
IsNull(CONVERT(varchar(5), DATEADD(ms, DATEDIFF(ms, F.ActualOutSheddingTime, F.ActualInsheddingTime), 0), 114) ,'00:00')as [Duration],
IsNull(DT.RestHours, 00) as [ShiftChangeoverTime],
IsNull(CONVERT(varchar(5), DATEADD(ms, DATEDIFF(ms, CONVERT(varchar(5), DATEADD(ms, DATEDIFF(ms, F.ActualOutSheddingTime, F.ActualInsheddingTime), 0), 114), Convert(Datetime, '00:'+ IsNull(Convert(varchar(30), DT.RestHours, 114), 30))), 0), 114),'00:00') as [Net Duration]
From Fleet F
Left Outer Join Duties DT on F.DutyID = DT.ID
Inner Join Depot D on DT.DepotId = D.ID
Inner Join Vehicles V on V.ID = F.VehicleID



Welcome for your valuable suggestions.

Vishnu

Vishnu Narayan Mishra
Software Engineer

AnswerRe: Problem in Finding Hours Duration Between two Dates Pin
Vishnu Narayan Mishra7-Jan-10 3:23
Vishnu Narayan Mishra7-Jan-10 3:23 
Questionproblem for build a query Pin
Rupesh Kumar Swami7-Jan-10 2:41
Rupesh Kumar Swami7-Jan-10 2:41 
AnswerRe: problem for build a query Pin
Dimitri Witkowski7-Jan-10 2:50
Dimitri Witkowski7-Jan-10 2:50 
AnswerRe: problem for build a query Pin
i.j.russell7-Jan-10 3:05
i.j.russell7-Jan-10 3:05 
QuestionHow to make a query stronger in SQL Server Pin
Member 42602707-Jan-10 0:30
Member 42602707-Jan-10 0:30 
JokeRe: How to make a query stronger in SQL Server Pin
WoutL7-Jan-10 0:49
WoutL7-Jan-10 0:49 
AnswerRe: How to make a query stronger in SQL Server Pin
Jörgen Andersson7-Jan-10 1:04
professionalJörgen Andersson7-Jan-10 1:04 
AnswerRe: How to make a query stronger in SQL Server Pin
i.j.russell7-Jan-10 2:36
i.j.russell7-Jan-10 2:36 
QuestionSQL Calculation... Pin
Illegal Operation6-Jan-10 12:44
Illegal Operation6-Jan-10 12:44 
AnswerRe: SQL Calculation... Pin
_Damian S_6-Jan-10 14:36
professional_Damian S_6-Jan-10 14:36 
Question[SQLite3] handling returned data from PRAGMA table_info("table_name") in C#? Pin
bbranded6-Jan-10 9:36
bbranded6-Jan-10 9:36 
AnswerRe: [SQLite3] handling returned data from PRAGMA table_info("table_name") in C#? Pin
loyal ginger6-Jan-10 9:59
loyal ginger6-Jan-10 9:59 
QuestionRe: [SQLite3] handling returned data from PRAGMA table_info("table_name") in C#? Pin
Dimitri Witkowski6-Jan-10 10:23
Dimitri Witkowski6-Jan-10 10:23 
AnswerRe: [SQLite3] handling returned data from PRAGMA table_info("table_name") in C#? Pin
Dimitri Witkowski6-Jan-10 10:22
Dimitri Witkowski6-Jan-10 10:22 
GeneralRe: [SQLite3] handling returned data from PRAGMA table_info("table_name") in C#? Pin
bbranded7-Jan-10 5:55
bbranded7-Jan-10 5:55 
GeneralRe: [SQLite3] handling returned data from PRAGMA table_info("table_name") in C#? Pin
Dimitri Witkowski7-Jan-10 6:17
Dimitri Witkowski7-Jan-10 6:17 
GeneralRe: [SQLite3] handling returned data from PRAGMA table_info("table_name") in C#? Pin
bbranded7-Jan-10 6:38
bbranded7-Jan-10 6:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.