Click here to Skip to main content
15,888,454 members
Home / Discussions / Database
   

Database

 
GeneralRe: pass the values Pin
Colin Angus Mackay18-Jun-07 14:26
Colin Angus Mackay18-Jun-07 14:26 
QuestionReturn Value from Stored Procedure Pin
seemamltn18-Jun-07 9:47
seemamltn18-Jun-07 9:47 
AnswerRe: Return Value from Stored Procedure Pin
Colin Angus Mackay18-Jun-07 13:18
Colin Angus Mackay18-Jun-07 13:18 
QuestionError message Pin
seemamltn18-Jun-07 9:43
seemamltn18-Jun-07 9:43 
AnswerRe: Error message Pin
andyharman19-Jun-07 7:23
professionalandyharman19-Jun-07 7:23 
QuestionStored Proc Pin
seemamltn18-Jun-07 8:51
seemamltn18-Jun-07 8:51 
AnswerRe: Stored Proc Pin
Colin Angus Mackay18-Jun-07 9:22
Colin Angus Mackay18-Jun-07 9:22 
GeneralRe: Stored Proc Pin
seemamltn18-Jun-07 9:43
seemamltn18-Jun-07 9:43 
Again thanks a lot but When I execute only this portion it gives me error

Syntax error converting the varchar value '2d 0h 0m' to a column of data
type int.

My stored procedure is the following.

Followed is the SQL Script and you can use this code in your SQL Function to
get the difference and make function with StartDate and EndDate parameters
and return the @Diff

DECLARE @Day INT
DECLARE @Hour INT
DECLARE @Minute INT
DECLARE @Start_Date DateTime
DECLARE @End_Date DateTime
SET @Start_Date = '6/13/2007 12:38 AM'
SET @End_Date = '6/14/2007 11:59 PM'
SET @Day = DATEDIFF( day, @Start_Date, @End_Date)
SET @Hour = DATEDIFF(hour , @Start_Date, @End_Date)
SET @Minute = DATEDIFF(minute , @Start_Date, @End_Date)
SET @Minute = @Minute-(@HOUR* 60)
SET @Hour = @Hour-(24* @Day)
SET @Diff = CONVERT( Varchar, @Day) +'d ' + CONVERT(Varchar , @Hour) + 'h '
+ CONVERT(Varchar , @Minute) +'m'
PRINT
'Difference : ' + @Diff



seema

GeneralRe: Stored Proc Pin
Colin Angus Mackay18-Jun-07 13:10
Colin Angus Mackay18-Jun-07 13:10 
QuestionSet Time Part Of DateTime Pin
Polymorpher18-Jun-07 7:41
Polymorpher18-Jun-07 7:41 
QuestionCDATA Sections in For XML query Pin
GaryWoodfine 18-Jun-07 6:28
professionalGaryWoodfine 18-Jun-07 6:28 
QuestionDatabase documentation tool recommendations? Pin
Max Stayner18-Jun-07 4:55
Max Stayner18-Jun-07 4:55 
QuestionQuery sql datatype Sql server 2005 [modified] Pin
Chazzysb18-Jun-07 4:31
Chazzysb18-Jun-07 4:31 
QuestionGet Value Pin
Navneet Hegde18-Jun-07 0:24
Navneet Hegde18-Jun-07 0:24 
AnswerRe: Get Value Pin
Sylvester george18-Jun-07 1:07
Sylvester george18-Jun-07 1:07 
GeneralRe: Get Value Pin
Navneet Hegde18-Jun-07 1:21
Navneet Hegde18-Jun-07 1:21 
GeneralRe: Get Value Pin
Sylvester george18-Jun-07 1:52
Sylvester george18-Jun-07 1:52 
GeneralRe: Get Value Pin
Navneet Hegde19-Jun-07 3:58
Navneet Hegde19-Jun-07 3:58 
QuestionCreating a table Pin
John.L.Ponratnam17-Jun-07 23:46
John.L.Ponratnam17-Jun-07 23:46 
AnswerRe: Creating a table Pin
Pete O'Hanlon18-Jun-07 0:01
mvePete O'Hanlon18-Jun-07 0:01 
AnswerRe: Creating a table Pin
Aaron VanWieren20-Jun-07 5:00
Aaron VanWieren20-Jun-07 5:00 
Questionsql Server 2000 Change table datas to another table Pin
kankeyan17-Jun-07 23:35
kankeyan17-Jun-07 23:35 
AnswerRe: sql Server 2000 Change table datas to another table Pin
Colin Angus Mackay17-Jun-07 23:41
Colin Angus Mackay17-Jun-07 23:41 
Generalthank u Pin
kankeyan17-Jun-07 23:49
kankeyan17-Jun-07 23:49 
Questionblob Pin
WhiteGirl2317-Jun-07 22:41
WhiteGirl2317-Jun-07 22:41 

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.