I have a datetime field and would like to get a new field (in a view) that substracts 10mn from it. Any function out there to do that?
Thanks
A quick example:
CREATE TABLE Tx (i datetime)
INSERT INTO Tx (i) SELECT '20040512 16:50'
GO
CREATE VIEW Vx AS SELECT i, DATEADD(mi, -10, i) AS NewColumn FROM Tx
GO
SELECT * FROM Vx
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Niles" <anonymous@.discussions.microsoft.com> wrote in message
news:157DB94F-A674-4A2F-A2A1-0704B278C5BB@.microsoft.com...
I have a datetime field and would like to get a new field (in a view) that
substracts 10mn from it. Any function out there to do that?
Thanks
Showing posts with label substracts. Show all posts
Showing posts with label substracts. Show all posts
Wednesday, March 7, 2012
Saturday, February 25, 2012
DateTime
I have a datetime field and would like to get a new field (in a view) that s
ubstracts 10mn from it. Any function out there to do that?
ThanksA quick example:
CREATE TABLE Tx (i datetime)
INSERT INTO Tx (i) SELECT '20040512 16:50'
GO
CREATE VIEW Vx AS SELECT i, DATEADD(mi, -10, i) AS NewColumn FROM Tx
GO
SELECT * FROM Vx
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Niles" <anonymous@.discussions.microsoft.com> wrote in message
news:157DB94F-A674-4A2F-A2A1-0704B278C5BB@.microsoft.com...
I have a datetime field and would like to get a new field (in a view) that
substracts 10mn from it. Any function out there to do that?
Thanks
ubstracts 10mn from it. Any function out there to do that?
ThanksA quick example:
CREATE TABLE Tx (i datetime)
INSERT INTO Tx (i) SELECT '20040512 16:50'
GO
CREATE VIEW Vx AS SELECT i, DATEADD(mi, -10, i) AS NewColumn FROM Tx
GO
SELECT * FROM Vx
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Niles" <anonymous@.discussions.microsoft.com> wrote in message
news:157DB94F-A674-4A2F-A2A1-0704B278C5BB@.microsoft.com...
I have a datetime field and would like to get a new field (in a view) that
substracts 10mn from it. Any function out there to do that?
Thanks
Subscribe to:
Posts (Atom)