Solved

crystal report formula do while statement

Posted on 2013-06-13
3
580 Views
Last Modified: 2013-06-14
Hello. I am new to Crystal. I have been handed a task where I need to get a date based on a specific location code.

Location Code      Date

12                           12/14/2012
14                           03/10/2013
11                           05/09/2013  
14                           06/24/2012
21                           10/12/2012

Not sure where to start. I believe I need a do while statement. Both of these fields are in the same table. Should be pretty easy, I'm just have not found anything to get me started yet.
0
Comment
Question by:truckkev
3 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39245998
Crystal works on 1 record at a time so there is nothing you can loop through.

Do you need all the records for the report?

Try this
Add a formula to the report
Name - LocationDate
If {Location Field} = DesiredLocation then
    {DateField}
Else
    Date(1900,1,1)

You can then get your value with
Maximum(({@LocationDate})

mlmcc
0
 
LVL 34

Expert Comment

by:James0628
ID: 39247094
What are you actually trying to do?  Are the codes and dates that you posted sample data?  If so, what are you trying to get from that data?

 James
0
 

Author Closing Comment

by:truckkev
ID: 39247985
Thanks,

That worked. It also cleared up some questions I had about Crystal. Thanks again.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

861 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

22 Experts available now in Live!

Get 1:1 Help Now