Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 807
  • Last Modified:

crystal report formula do while statement

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
truckkev
Asked:
truckkev
1 Solution
 
mlmccCommented:
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
 
James0628Commented:
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
 
truckkevAuthor Commented:
Thanks,

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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now