Dim TempDate As DateTime = DateTime.Today.AddMonths(7)
Dim TargetDate As New DateTime(TempDate.Year, TempDate.Month, 1)
I like your way better, seems cleaner.
BTW, who's Fred? :^)
Greg
"Richard K Bethell" <so*****@spammingisevil.bad> wrote in message
news:OQ**************@tk2msftngp13.phx.gbl...
"Brad" <ba******@ukcdogs.com> wrote in message
news:eD**************@TK2MSFTNGP11.phx.gbl... Is there an easy way to set a date to the beginning of the month? Say I
want to add 7 months to today (except that today is not a good reference
as it would figure out to be March 1)...say I add 7 months to 09/06/2004 and
I get a returned date of 03/06/2005. What I then need to do is to take
that
date and make it 03/01/2005. Is there an easy way to do this?
Thanks for the information.
Brad
Dim TempDate as DateTime = DateTime.Now.AddMonths(7)
Dim TargetDate as New DateTime(Fred.Year, Fred.Month, 1, 0, 0, 0)