RE: DateAdd problem
- From: Klatuu <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Apr 2005 08:20:08 -0700
=MonthEndDate(DateAdd("m",-3,[text0]))
Function MonthEndDate(dtmBaseDate As Date) As Date
Dim intCurrMonth As Integer
intCurrMonth = DatePart("m", dtmBaseDate)
While DatePart("m", dtmBaseDate) = intCurrMonth
dtmBaseDate = DateAdd("d", 1, dtmBaseDate)
Wend
MonthEndDate = DateAdd("d", -1, dtmBaseDate)
End Function
"RussG" wrote:
> In the following expression, Access is not giving me the month-end date:
> =DateAdd("m",-3,[text0])
>
> For example, if [text0]= #3/31/05# the result is 12/31/04, BUT if
> [text0]=#6/30/04# the result is 3/30/04 (I thought Access would automatically
> return 3/31/04). What the heck!
> As always, thanks for the help!
> Russ
.
- References:
- DateAdd problem
- From: RussG
- DateAdd problem
- Prev by Date: RE: Incremental increasing a Fields numeric value
- Next by Date: Syntax Error
- Previous by thread: Re: DateAdd problem
- Next by thread: Cascading with 2 combo box and a text box with a subform
- Index(es):