Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7833187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:35:47+00:00 2026-06-02T12:35:47+00:00

I am using Crystal Reports XI R2. My table has transaction data by date.

  • 0

I am using Crystal Reports XI R2.

My table has transaction data by date. I have a group set up by day and a summary to give a count of transactions for each day. I also have a running total set to give a year to date count for each day. Of course it resets on a change in year.

My goal is to be able to find the difference between the YTD count yesterday and the same for the same date last year.

Edit: I’ve misstated the goal. It isn’t to be able to find the difference for just yesterday, but for each day in a range of days.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:35:50+00:00Added an answer on June 2, 2026 at 12:35 pm

    I finally got this nailed down. There is likely a cleaner way of doing this, but….

    I converted the dates (started as text yyyy-mm-dd) into text mm/dd/yyyy format:

    stringvar yyyyear := {table.dateField}[1 to 4]; 
    stringvar mmonth := {table.dateField}[6 to 7];;
    stringvar dday := {table.dateField}[9 to 10];
    
    mmonth + "/" + dday + "/" + yyyyear
    

    Grouped by this field and inserted a count summary into the group header. Created a separate field for the mm/dd portion of each date:

    {@textDate}[1 to 5]
    

    Added a flag to see if the date in the current group header matched the previous:

    if previous({@mm/dd}) = {@mm/dd}
        then 1
    else 0
    

    Used a shared variable to store the YTD totals for each year (2 formulas):

    shared numbervar totalsCurentYear;
    
    if {@prevDateFlag} = 1 then 
        totalsCurrentYear := totalsCurrentYear + Sum ({@transactionCount}, {@textDate});
    
    totalsCurrentYear
    

    |

    shared numbervar totalsLastYear;
    
    if {@prevDateFlag} = 1 then 
        totalsLastYear := totalsLastYear + Sum ({@transactionCount}, {@textDate});
    
    totalsLastYear    
    

    Put both of these into the group footer (suppressed) and added a field to do the subtraction into the group header.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Visual Studio 2005 with VB.NET. I have a number of Crystal Reports,
I have some Crystal Reports that were created using Crystal (external to Visual Studio)
I am confused in using parameter in Crystal Reports I have mapped the required
I have a winforms applications that does some reporting using Crystal Reports for Visual
I have created reports using Crystal Reports in my asp.net application(vb). It was fine.
I'm using Crystal Reports in vs2008, so I'm using datasets with procedures to get
I want to create a report, using either Crystal reports or RDLC, doesn't really
Is it possible to rename a report section in a crystal reports using the
I infrequently (monthly/quarterly) generate hundreds of Crystal Reports reports using Microsoft SQL Server 2005
I'm using MySQL with Vb.Net 2010 and Crystal Reports and to be honest I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.