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

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

Need to pull only last entry in a multi entry field

I have a crystal report that groups records by invoice number, and a subreport to pull notes from the customer table.  The problem is the note field has multiple entries.  The subreports pulls all the customer notes.  I need to only pull the last entry. I can't seem to get it to do so.
is this possible?
0
Henrymarc
Asked:
Henrymarc
3 Solutions
 
peter57rCommented:
I don't really understand what you mean by " the note field has multiple entries".
How are the notes entered so that you end up with multiple entries in one field- what distinguishes one note from another within this field?
0
 
mlmccCommented:
Do the notes records have an indication of the last one?
Date, sequence number?

If so one way to do this is to group on the invoice number in the subreport
Sort descending on the date field or sequence number
Show the notes field in the group header
Suppress the details

mlmcc
0
 
HenrymarcAuthor Commented:
Note Id and date for each note in the field distinguishes one note from the next.  The last entry is at the top.
0
 
mlmccCommented:
If you are grouped by invoice number and put the note field int he group header you will get the desired result.

If you need details for other things just don't add the notes field

mlmcc
0
 
James0628Commented:
Is each note in a separate record?  You said that you have "a subreport to pull notes from the customer table".  If that's some kind of customer master table, I would normally expect there to be one record for each customer, with "notes" stored in another table.  Or is that a "customer notes" table?

 IAC, I'm assuming that you have the subreport linked by the customer, so it displays the notes for the current customer in the main report.  If each note is in a separate record and you only want to see the first record, you could add a group on the customer to the subreport, sort by date or whatever to get the notes in the desired order, put the note field in the group header, and suppress the other sections in the subreport.  Assuming that the subreport is just using the table as the datasource, I don't think there's any easy way to have it only read the latest note, but if you set it up as described above, you will only see the latest note.

 James
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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