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

month breakdown question

Status
Not open for further replies.

rrmcguire

Programmer
Oct 13, 2010
304
US
Hello,

I don't know if this will explain everything clearly of what Im trying to do but here we go...I have a formula "dispatch profit" which calculates per user how much money they have earned for a certain time period which is entered in by a date range for example ....pick up date between 3/1/11..5/10/11, which is then broken down by a month grouping so it shows the results for each month on separate pages.

What Im trying to do is have everything all on one section and/or page as far as my monthly figures, so the dispatch profit will be calculated for the months of March, April, and the current month of may each broken down only for that month yet all on one section.

The problem being when I run the report I have to put in a date range from the start being 3/1 to the end in this case being 5/10.

Dispatch profit is just a figure which is summed up but currently is grouped by a month formula as this:


if {@Pickup Date} >= {@Min Date} and {@Pickup Date}<= {@Max Date} then

"'" &
Right(Left(ToText (Year ({@Pickup Date})),InStr (ToText (Year ({@Pickup Date})),'.')-1),2) &
" " &
{@Month Place}&Left(ToText (Month ({@Pickup Date})),InStr (ToText (Month ({@Pickup Date})),'.')-1) &
MonthName (Month ({@Pickup Date}))

else if {@Pickup Date} >= {@Min Date 2} and {@Pickup Date}<= {@Max Date 2} then

"'" &
Right(Left(ToText (Year ({@Pickup Date})),InStr (ToText (Year ({@Pickup Date})),'.')-1),2) &
" " &
{@Month Place}&Left(ToText (Month ({@Pickup Date})),InStr (ToText (Month ({@Pickup Date})),'.')-1) &
MonthName (Month ({@Pickup Date}))

else ''

any help or guidance would be appreciated


 
1. what are you wanting to see? provide as good a visual example of the desired output as possible within the forum.
2. what are the contents of your formulas?
3. what does you sample data look like?

also, it never hurts to give your crystal version and type of database being used.

 
It's easy to get months or year/months in Crystal, something like
Code:
Year({your.date) & "/" & Month({your.date)
(DatePart can be used for other parts of a date.)

You can then use @MonthYear to create group, and get totals for that group. Or to a Crosstab.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Crystal Version is 8.5, basically when the report is run a user id is entered in this case LKD which pulls a record of her shipments which each have a "dispatch profit" total associated with it. You then have to input the pickup date range for the month you're trying to gather your data on..in this case 5/1/11..5/10/11....what Im trying to display is the dispatch profits from the previous 2 months....

Currently everything is in a group by the month inputted in a parameter field. So when the report prints it prints for each month put in that parameter field, so if you put in 3/1/11..5/11/11, it prints the section 3 times....basically I want everything on one page....Im thinking I need to remove my grouping per month and start from there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top