×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Multiple Date Parameters In Same Report

Multiple Date Parameters In Same Report

Multiple Date Parameters In Same Report

(OP)
I am working on a report where I have to extract data in the following format:
___________________________________________________________

YTD 2000 Total

January 2001 MTD Total
February 2001 MTD Total
March 2001 MTD Total
April 2001 MTD Total
May 2001 MTD Total

6/1/01
6/2/01
6/3/01
6/4/01  and so on for the month

YTD 2001 Total
___________________________________________________________
So basically, reviewing above I need a Total YTD for last year, and MTD totals for previous month of this year, and if current month, give detail by day.

Can you help?

RE: Multiple Date Parameters In Same Report

You can create separate conditional totals for each period you need, and then total each formula.  One example would be:

If {date} in MonthToDate
then {quantity}
else 0

Ken Hamady
http://www.kenhamady.com/
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.

RE: Multiple Date Parameters In Same Report


Create 3 formulas and name them Year, Month & Day

Add the respective code to each:
Year({YourDateField})
Month({YourDateField})
Day({YourDateField})

Insert 3 Groups based on these formula fields Year, Month & Day

Add the field you want to total to the detail line

Right click on the field and goto Insert>Summary...

Select Sum from the dropdown and sort and group by Year from the dropdown

Check the 'Insert summary fields for all groups'

Suppress the detail line

Goto Format Section
For the Group Footer #3: - @DayA section click on the Formula icon next to Suppress and add the following.

Date (Year ({YourDateField}), Month ({YourDateField}), 1)
<>
Date (Year (CurrentDate), Month (CurrentDate), 1)

For the Group Footer #2: - @MonthA section click on the Formula icon next to Suppress and add the following.
Year ({YourDateField}) <> Year (CurrentDate)

Suppress each Group header and the detail line

The above is based on the assumption that you have multiple records per day. If you have a single record per day then it would be a little different

Hope this helps,

Jase

RE: Multiple Date Parameters In Same Report

I forgot..in your Record Selection formula add:

{YourDateField} >= DateValue (Year (CurrentDate) - 1, 1 ,1 )


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close