Gustav Brock
Gustav at cactus.dk
Mon Feb 21 10:39:36 CST 2005
Hi Mark
You could use:
dteCurrent = DateAdd("m", intMonth, dteStart)
intMonthCurrent = Month(dteCurrent)
intYearCurrent = Year(dteCurrent)
/gustav
>>> dba.email at gmail.com 21-02-2005 17:20:30 >>>
Gustav,
Thank you. This allows me to run the query the requisite number of
times. How then would I feed the current month/year of the loop into
that query as criteria?
Mark
On Mon, 21 Feb 2005 16:00:53 +0100, Gustav Brock <Gustav at cactus.dk>
wrote:
> Hi Mark
>
> I would use
>
> intMonths = DateDiff("m", dteStart, dteEnd)
> For intMonth = 0 To intMonths
> ' Run query.
> Next
>
> /gustav
>
> >>> dba.email at gmail.com 21-02-2005 15:46:51 >>>
> Group,
>
> Monday morning has arrived:( I have a form with 2 calendar controls
> that can provide a date range. I would like to use this date range
as
> criteria for a query. However, I am having difficulty with the
> following scenario. Given a multiple-month date range, I would like
> to run the query "n" number of times for each month in the range.
The
> solution must be able to span multiple years if needed.
>
> Pseudo code:
> dteStart = 8/1/2004
> dteEnd = 1/31/2005
>
> For each month in the date range
> run the query
> Next month
>
> Any suggestions?
>
> Mark Mitsules