veramente a me non serve in un altro campo il giorno ma come funzionerebbe se volessi metterlo nello stesso campo?
se provo:
USE tempdb;
GO
CREATE TABLE dbo.Dates(
Data_In datetime NOT NULL,
Data_Out datetime NOT NULL
);
GO
INSERT dbo.Dates VALUES('20060803 14:49:57.623', '20060804 15:59:57.343');
INSERT dbo.Dates VALUES('20060803 15:59:58.323', '20060805 16:03:57.343');
GO
SELECT
CONVERT(char(24), Data_Out - Data_In, 113) AS DateDifferenceFormatted
FROM dbo.Dates;
GO
/* Output:
DateDifferenceFormatted
-----------------------
02 Jan 1900 01:09:59:720
03 Jan 1900 00:03:59:020
(2 row(s) affected)
*/
DROP TABLE dbo.Dates;
non va bene poiche a me servirebbe solo il giorno ed inoltre inizia a contare dal 1900, come dovrei modificare la query?
grazie ancora