```
DECLARE @PreviousMonthStart DATETIME
DECLARE @PreviousMonthEnd DATETIME

SET @PreviousMonthStart = DATEADD(m,DATEDIFF(m,0,GETDATE())-1,0)
SET @PreviousMonthEnd = DATEADD(ms,-2,DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0))

PRINT @PreviousMonthStart
PRINT @PreviousMonthEnd

```

when executed above query the result set is in the below format

```
Mar  1 2017 12:00AM
Mar 31 2017 11:59PM

```

But I need result set in below format

```
2017-04-01 00:00:00.000

```

any help