N
Naresh Kumar Saini
I am new to Access and working on an Access database where I have to a print
report grouped on custom defined time-chunks, e.g.
From a given date -- Today or [End Date] -- Parameter entered by user at
print time:
(1) All dates Less Than Three Months old (27-May-2003 to 26-August-2003)
(2) All dates Between Three Months & Six Months
(3) All dates Between Six Moths & One Year
(4) All dates Between One Yesr & Two Year
(5) All dates More Than Two Year old
Access has in-built support for grouping on months, quarters, years, etc but
I need custom, un-equal groups from a given date. I also need to count, etc.
records falling in each group and I think Domain Aggregate functions
(DCount, etc) can be used for it. I can calculate a date 'Three Months
Before' with DateAdd function. But I can not defince a Section/Group of
required group of time-chunk.
I am a new user to Access.
Naresh
(e-mail address removed)
PS: I created a text box in Page Header of my Report and tried to define its
Control Source property as below (to calculate records falling withing first
time-chunk):
=DCount([Experiment_ID],"Experiment","[OrderDate] <= [End Date] and
[OrderDate] > DateAdd ("m", -3, [End Date])")
where Experiment is table name, OrderDate is date field, [End Date] is user
input (parameter) supplied by user at the time of printing of report.
I built the formula with formula builder or directly type it; but always
when I come out it (no Save command in Access) the text box is still
'unbounded' and the formula is gone. Even if I try to copy and past this
formula in some other text box, it is not saved and still the older content
of text box is there. Is the formula too long or something? Yet, the
following is working OK and giving correct result -- [Begin Date] parameter
is supplied by user:
=DCount([Experiment_ID],"Experiment"," [OrderDate] >= [Begin Date] and
[OrderDate] <= [End Date] ")
I wonder why?
report grouped on custom defined time-chunks, e.g.
From a given date -- Today or [End Date] -- Parameter entered by user at
print time:
(1) All dates Less Than Three Months old (27-May-2003 to 26-August-2003)
(2) All dates Between Three Months & Six Months
(3) All dates Between Six Moths & One Year
(4) All dates Between One Yesr & Two Year
(5) All dates More Than Two Year old
Access has in-built support for grouping on months, quarters, years, etc but
I need custom, un-equal groups from a given date. I also need to count, etc.
records falling in each group and I think Domain Aggregate functions
(DCount, etc) can be used for it. I can calculate a date 'Three Months
Before' with DateAdd function. But I can not defince a Section/Group of
required group of time-chunk.
I am a new user to Access.
Naresh
(e-mail address removed)
PS: I created a text box in Page Header of my Report and tried to define its
Control Source property as below (to calculate records falling withing first
time-chunk):
=DCount([Experiment_ID],"Experiment","[OrderDate] <= [End Date] and
[OrderDate] > DateAdd ("m", -3, [End Date])")
where Experiment is table name, OrderDate is date field, [End Date] is user
input (parameter) supplied by user at the time of printing of report.
I built the formula with formula builder or directly type it; but always
when I come out it (no Save command in Access) the text box is still
'unbounded' and the formula is gone. Even if I try to copy and past this
formula in some other text box, it is not saved and still the older content
of text box is there. Is the formula too long or something? Yet, the
following is working OK and giving correct result -- [Begin Date] parameter
is supplied by user:
=DCount([Experiment_ID],"Experiment"," [OrderDate] >= [Begin Date] and
[OrderDate] <= [End Date] ")
I wonder why?