Monday, 3 December 2012

Datediff with sql server

Date-
1.       select DATEDIFF(MILLISECOND ,GETDATE()-1,GETDATE()) as milisecond


Time-

1.       select right(convert(varchar(30),getdate(),121),12)
                             outpur-- 15:02:24.3424398

2.       SELECT CONVERT(VARCHAR(16), SYSDATETIME(), 14)

                              outpur-- 15:02:24.3424398

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...