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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weekly reports based on dates 2

Status
Not open for further replies.

AFK

Programmer
Oct 5, 2004
23
US
I am trying to get a report based on the dates that I will send as parameter. I can select any date range lets say sdt_dateentered = '08/01/04' and sdt_dateend = '09/03/04'.So when I enter this date the report should be in formatt of multiple weeks(for each week from Aug to Sept.), and each week seperatly marked.
Center week1 week2
08/2/04-08/06/04 08/09/04-08/12/04
Indianapolis 90calls 13
Detriot 3 4

Now if I enter only sdt_dateentered = '10/04/04' and sdt_dateend = '10/08/04', the report should have data for one week, marked with that week only.

Center week1
10/04/04-10/08/04
Indianapolis 90calls
Detriot 3


90 calls is number of Indianapolis appeared in this week(or indianpolis calls number). I will send the dates and the report has to show results based on dates.
 
How are you getting your weeks? Is it something you want to do, or are you aready doing it.

If you want to do a crosstab based on whole weeks, you can get week number from
Datepart("ww", @yourdate)
If you then use the parameter dates in your record selection, that should do it.

It helps to give your Crystal version, since newer versions have extra options, and some extra problems. I use Crystal 8.5.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
How are you getting your weeks? Is it something you want to do, or are you aready doing it.

Here is the problem, I don't know weather the dates that user will provide is for a week or two weeks or just couple of days.User can select any two dates (From @DateEnter to @DateResolve).
When user enters two dates, the report should deside that?I don't knwo how can I do that?
 
Everything Madawc suggested makes good sense, including sharing technical information, such as your Crystal version.

Why does one column have 90CALLS in the first line and the next line omits the text calls? Odd formatting in the post or the design.

Insert a Cross-tab, place the table.date as the Column (change the options to Per Week, how this is done is based on your version, which you prefer to keep a secret), the city as the row, and the calls as the summary. It won't haev the title Week 1, but otherwise it'll be what you seek and it only takes a few minutes to design.

-k

 
Yes the Cross-tab is good idea, but the problems is that my report consists data for 10-15 centers and Cross-tab shows each center seperately, I can not make it one whole creoss tab(or may be I don't know how to make it one with multiple columns).Now instead od one I have as many cross-tabs as centers.

Is it possible to create one.
 
Place the crosstab as SV described it in your report header or footer.

-LB
 
Thank you very much all of you. It did work for me.But..
the only one item is when I send a date my report picks each week's sunday instead of starting from Monday. I want this to start from monday to friday. How do I do that?
 
lbass and synapsevampire I need quick help please. I am almost finished with this report. Please advise how do I set up to start from monday through friday, instead of Sun through Sunday, based on dates.
Everything works fine.But the report prints data from One sunday to other and I need from Monday to friday. How do I set up this day function. I am a new with CR.
I put the crosstab in header and it worked.

Thanks for your support.
 
If you're using Datepart, then try
Datepart("ww", @yourdate, 2)
That tells it that you want to start from Monday, Day 2 within Crystal, rather than Sunday or Day 1)
If that doesn't work, look up Crystal Help for the FirstDayOfWeek function.


[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
But how do I use this function. I don't have help installed.
 
When people are volunteering their time to help, it's not really a good idea to demand their quick response--many people won't respond in this case. It sounds to me like you just want to display the Monday to Friday dates on each column--not that you actually want to change the way the dates are grouped. To change the display, while in the crosstab, highlight the column field->group options->print for each week->customize group name->use a formula->x+2 and enter:

totext({table.date}-dayofweek({table.date})+2,"MM-dd-yy")+" - "+ totext({table.date}-dayofweek({table.date})+6,"MM-dd-yy")

You might have to refresh the report to see the change in the headings. While in preview, you also probably need to resize the column heading to show the entire field by clicking and dragging the boundary.

-LB
 
Thank you very very much...It worked.I am sorry about that, but I was anxious about my report. This is my first report, and I am learning how to do it.
But you helped me a lot..Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top