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

Comparing two different date range?!

Status
Not open for further replies.

hoppeli

Technical User
Apr 10, 2005
16
FI
How I can compare two user named different date range so that selected records are within date ranges and subtotals and grand totals are right? I should also have headers and totals right in reposrt (not in subreport)! Example: I can have records of parameter dates right and use subreport to make the comparison, but I cannot have right headers and total of date range. I have tried running totals, summary, SQL etc. in report without any help. I know it may be just formula problem, which I cannot make, but still, I cannot compare any different date randes (like two diffetent years's sales) satisfactory. Please, give some advise.
 
Dear Hoppelli,

It is difficult to understand your questions.

Helpful information:

What version of Crystal and what database and driver.

What are you trying to accomplish, with maybe an example.

Post current select criteria.

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Hi Rosemary!

I use MS SQL 7.0 with CR 8.5.

Basically I would like to have as follows:

CUSTOMER START DATE- REFERRING START DATE
END DATE REFERRING END DATE
----------------------------------------------------------
cust 1 10000 EUR 40000 EUR
cust 2 3450 EUR 23455 EUR
etc.
----------------------------------------------------------
TOTALS 13450 EUR 63455 EUR

parameters now are ?Start date and ?End date. I use subreport now to get referring date range and use similar parameters. This way it is dynamic range. The problem also is to get the REFERRING START and END DATE to the page header - at the moment in subreport it does not work.

RGDS

Hoppeli
 
Dear Hoppeli,

Hopefully, you will not think me dense, but I still don't understand what you want.

Is the data for Start Date and End Date and Referring Date and End Date in the same tables on the main report? Then, I do not believe you would need subreport.

Selection criteria would be something like:

({Table.Date1} in {?Start} to {?End})
or
((Table.Date2} in {?Refer Start} to {?Refer End})

This will obviously more records because you will have records that match on both, one or the other.

So the next step is to create two formulas:

//Formula for Start End Column

IF {Table.Date1} in {?Start} to {?End}
then {Table.StartEndDateColumnEurosField}
else 0


//Formula for Referring Start and End Column

IF {Table.Date1} in {?Ref Start} to {?Ref End}
then {Table.RefStartRefEndDateColumnEurosField}
else 0


Now, you place the formulas in the detail section and sum to your hearts content.

Without details it is hard to help as you did not indicate what the column names are for the two Euro amounts you are showing.

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Hi Rosemary,

I hope you do not think me to be Homer...Truth is I have studied and learned myself all of CR and thus cannot be smart using formulas and comparisons.

I have tried to make "or" record selection, but it has not been worked out. I try you advises when I have time to do it.

Thanks of your advises!!

Hoppeli!

PS. Ed! If you read this, please do not tell this to anyone... :)

Heikki
 
Dear Heikki,

I am sure that you can indeed do it. Sometimes things can be frustrating at first, and eventually the lightbulb comes on and all is revealed.

Don't give up and please do not be so hard on yourself ... I remember a long, long time ago when I worked with VAX's, I was new to reporting and had to use a tool called VAX DataTrieve. It came with 12! manuals and I didn't get to go to any classes. I think I literally, not figuratively, banged my head against my desk on a daily basis, almost in tears that I couldn't get it to do what I wanted. And, then, one day things started to make sense to me. I have specialized in reporting ever since.

Are you the same Heikki from the MagicSolutions forum?

Best regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Hi Ro,

unfortunately I am not the same you thought.

I amsure I can do it, unfortunately I do not have enough time to concentrate to work with CR. Learning by doing is in a way good method.

Heikki
 
Why not post what you have so we can see what you are attempting to do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top