Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 .NET Inside SQL Server (2005)
 query for date and time

Author  Topic 

bhanuprakashi
Starting Member

1 Post

Posted - 2009-02-12 : 08:12:31
hi
we want a query that get year/month/day/hours/minutes/seconds with out spaces and special characters between them can any one help on this


Thanks And Regards
Bhanu Prakash
09849926225
09394799379

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-12 : 08:33:59
[code]SELECT REPLACE(REPLACE(REPLACE(CONVERT(CHAR(19), GETDATE(), 120), ' ', ''), '-', ''), ':', '')[/code]


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-12 : 08:35:09
[code]SELECT REPLACE(REPLACE(REPLACE(CONVERT(CHAR(19), GETDATE(), 120), ' ', ''), '-', ''), ':', ''),
CONVERT(CHAR(8), GETDATE(), 112) + REPLACE(CONVERT(CHAR(8), GETDATE(), 114), ':', '')[/code]


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

hi2sunil
Starting Member

3 Posts

Posted - 2009-04-20 : 14:15:10
Select Replace(Replace(Replace(Replace(Convert(VarChar(20),GetDate(),127),'-',''),':',''),'T',''),'.','')

Thanks
Sunil Kovvur
Go to Top of Page
   

- Advertisement -