Solved

How to group by month & year in Crystal.

Posted on 2008-06-19
6
5,091 Views
Last Modified: 2010-04-21
I know this is simple, but I'm new to Crystal.  I am doing a sales report and want to group data by the month the transaction was entered.  I have a time field in the transaction table, but don't know how to group by month or by year.  I know I need to create a formula, but don't know how and am short on time.  I will be learning more in the future on this since we are generating a ton of reports.

Thanks
0
Comment
Question by:nkrueger84
6 Comments
 
LVL 13

Accepted Solution

by:
crgary_tx earned 300 total points
ID: 21826184
i assume you have a date field in the table?

create two crystal formulas say..

//@year
year({datefield})

//@month
month({datefield})

then group the report based on the above formulas. you might want to format the group fields for year and month later

hth..
Gary
0
 

Author Comment

by:nkrueger84
ID: 21826262
Great - that works! How do I clean the field up?

I have this:
{Transaction.Time}) & '/' & Year ({Transaction.Time})

The output looks like this:
6.00/2,001.00

How do I get it to be this?
6/2001

Thanks!
Nick
0
 
LVL 13

Assisted Solution

by:crgary_tx
crgary_tx earned 300 total points
ID: 21826476
replace with this formula:

left(cstr(date({Transaction.Time})),2)+'/'+right(cstr(date({Transaction.Time})),4)
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 100

Expert Comment

by:mlmcc
ID: 21827357
You can also use the group field.

WHen you group on a date field you have an option to choose the period.
day, week, month, etc

mlmcc
0
 

Assisted Solution

by:suresh-infotech
suresh-infotech earned 200 total points
ID: 21829547
hi. Try this formula

ToText(Transaction.Time, "MM") + '/' + ToText(Transaction.Time, "yyyy")
0
 

Author Closing Comment

by:nkrueger84
ID: 31468962
Thanks guys - I ended up using a combination of the 3 of your answers.  I appreciate everyone's help - I'm sure there will be many more Crystal questions...
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now