Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2015
    Posts
    1

    Unanswered: Setting a limit for the number of returned locations

    Hello,

    I'm new to crystal reports and trying to learn the SQL behind it.

    I have a crystal report label that is currently pulling all the locations for an SKU in the "Pick Ticket" (attached image)

    Click image for larger version. 

Name:	Locations.JPG 
Views:	1 
Size:	53.8 KB 
ID:	16595

    I would like for the label to just pull 1 location that has the oldest In Date.

    The Code Click image for larger version. 

Name:	Code.png 
Views:	1 
Size:	9.0 KB 
ID:	16596

    Here is where I think I need to add something around the "Locations.loc_desc" since it is pulling multiple locations.

    So comparable to Excel, something like a "Max=1" function.

    Thank you!

    Ryan

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I'd handle this in the underlying SQL, given the choice. Much better performing!
    If you can't do that, then you'll need to do a running count (or similar) numbering function that you can filter on... this is tricky, messy and slow, though!
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •