oops. hit send before I was done
I have the following so far
--1 Gives date as first day of the month six months ago and returns
2012-11-01 00:00:00.000
declare @date_six_months_ago datetime
set @date_six_months_ago = REPLACE(CONVERT(varchar(8), ( DATEADD(month, -6,
CAST(FLOOR(CAST(getdate() AS float)) AS DATETIME))), 102), '.', '') + '01'
--2 Gives date of oldest entry in data returns 2002-01-03 18:01:06.923
declare @oldest_entry datetime
SELECT MIN([when]) [when] FROM audit
Whilst above SELECT works, I struggle to get this into a set statement for
@oldest_entry datetime
If anybody could help me with this it will be appreciated.
C
"Cathy" <Ca...@Nospam.com> wrote in message
news:FKadnVHIbYpc-Q_M...@bt.com...