User Profile
Collapse
-
yes,i have an ID column called INDEX (unique value) for each row. -
How to calculate duration using diff function
Hello!
I have a table in a database where there is a column called DATE (datetime type)that logs the date/time of an event.The first index of the table it represent the start date/time and the last index of the table represent the final date/time.
How can i make a query that returns the duration between the start date/time and final date/time?
i tryed to do:
Code:select DateDiff(hour,select DATE from mytable where INDEX=(select
-
Thanks!
It makes sense!
I do not have very much experience with SQL and the code that I have is a mixture from diferents howto's!Leave a comment:
-
How to query another server with stored procedure
Hello!
I have this stored procedure:
Code:set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[test_proc] AS BEGIN DECLARE @DestDB nvarchar(100) DECLARE @SQL nvarchar (2000) SET @SQL = NULL SELECT @DestDB = param1 from [SERVER1\SERVER1].master.dbo.CAConfig SET @DestDB = '[SERVER1\SERVER1].' + @DestDB + '.dbo.TestDBFromServer1'
No activity results to display
Show More
Leave a comment: