Skip to main content
added 49 characters in body
Source Link
marc_s
  • 759.9k
  • 186
  • 1.4k
  • 1.5k

The belowI have this code in sql serverSQL Server 2016

SelectSELECT convertCONVERT (DATETIME, convertCONVERT(varchar(8), ExpiryDate)) 

is givingI get this result as:

ExpiryDate ------------------------ 2020-08-03 00:00:00.000 

howHow can iI remove the .000.000 (the milli secondmilliseconds part).?

Expected Resultresult should be:

2020-08-03 00:00:00 

Please help

The below code in sql server 2016

Select convert(DATETIME, convert(varchar(8), ExpiryDate)) 

is giving result as

ExpiryDate 2020-08-03 00:00:00.000 

how can i remove .000 (the milli second part).

Expected Result

2020-08-03 00:00:00 

Please help

I have this code in SQL Server 2016

SELECT CONVERT (DATETIME, CONVERT(varchar(8), ExpiryDate)) 

I get this result:

ExpiryDate ------------------------ 2020-08-03 00:00:00.000 

How can I remove the .000 (the milliseconds part)?

Expected result should be:

2020-08-03 00:00:00 

Please help

Source Link

Removing millisecond from datetime throwing error

The below code in sql server 2016

Select convert(DATETIME, convert(varchar(8), ExpiryDate)) 

is giving result as

ExpiryDate 2020-08-03 00:00:00.000 

how can i remove .000 (the milli second part).

Expected Result

2020-08-03 00:00:00 

Please help