Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wanted three latest (dates) for memo field

Status
Not open for further replies.

datahead2009

Programmer
Dec 9, 2009
3
US
I just need a way to display the "top three records" of a table that contains a date, user id, and memo field. I want these records by user. Output: User, Date, Memo field.
 
Yes, the three latest memo fields for that specific individual( by Memo Date ). Report is run for each individual. By the way I tried ranking in SQL. The SQL ranks for all people, not just one.

I tried crystal reports summary, does not work for memo fields.
 
You could do a top N statement by using Add Command and entering something like:

select top 3 table.`date`, table.`user ID`, table.`memo`
from table
where table.`user ID` = 123
order by table.`date` desc

Or you could write a conventional report where you limit the records to one user in the selection formula, sort in descending order by the date field, and then use a suppression formula on the detail section of:

recordnumber > 3

-LB
 
lbass,

Thanks for the info. I figured out the same thing as your first choice ! Way to go. Thanks for your help.

The only thing I did different was pass a parameter (userID) to the SQL command, utilizing the Top N method. !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top