Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reporting Detail On LastFullWeek

Status
Not open for further replies.

DKirksgirl

Technical User
Feb 22, 2001
12
0
0
US
I have a production report showing totals for previous months and detail for current month.

Jan 2002
Feb 2002
Mar 2002
Apr 2002
May 2002
Jun 2002
Jul 2002 (last day is on a Wednesday)
08/01/02 (Thursday)
08/02/02 (Friday)
08/03/02 (Saturday)
08/04/02 (Sunday)

My problem is reporting the last full week when months overlap. For instance, in my report, my week is defined as being from Monday-Sunday. Monday in this case above was July 29th. The "last full week" should be from July 29th through August 4th.
I have a group defined as
If {T_LN_STAT.STAT_AGGR_DT} in YearToDate then Month({T_LN_STAT.STAT_AGGR_DT})

then I have a group after that one defined as
{T_LN_STAT.STAT_AGGR_DT}

My report selection criteria has this date definition in it:
{T_LN_STAT.STAT_AGGR_DT} >= Date (Year (CurrentDate),1,1) and
{T_LN_STAT.STAT_AGGR_DT} <= DATEADD(&quot;d&quot;,1,minimum(LASTFULLWEEK)) TO DATEADD('d',1,maximum(LASTFULLWEEK))

I know that the July month is being grouped and totalled because I have defined the group called @Month (this formula just defines the months as if 1 then Jan, if 2 then Feb and so on...). However, no matter when I generate my report during the week, it should report daily totals for the last full week. Like I said, I know what it's doing and why, I just don't know how to fix it. UGH!

Please help if you can.
Donna
 
So the months are real months, and the last bit of data displayed is the last full week, correct?

I'd treat them as separate entities, because they are.

You can change this:

If {T_LN_STAT.STAT_AGGR_DT} in YearToDate then Month({T_LN_STAT.STAT_AGGR_DT})

to just inserting a group and selecting FOR EACH MONTH since your record selection criteria has already omitted rows not in yeartodate.

The simplest means might be to create a subreport which shows ONLY the lastfullweek.

Some details to work out there, but that's the theory.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top