2012年2月26日星期日

First day of month of 3 months ago

How can I get the date of the first day of the month of
3 months ago in one statement ?
(And with no time in it ??)

Arno de Jong, The Netherlands.SELECT DATEADD(MONTH,-3,
DATEADD(DAY,1-DAY(CURRENT_TIMESTAMP),
CONVERT(CHAR(8),CURRENT_TIMESTAMP,112)))

--
David Portas
----
Please reply only to the newsgroup
--

"A.M. de Jong" <arnojo@.wxs.nl> wrote in message
news:bpvelg$ii7$1@.reader10.wxs.nl...
> How can I get the date of the first day of the month of
> 3 months ago in one statement ?
> (And with no time in it ??)
> Arno de Jong, The Netherlands.

没有评论:

发表评论