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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting records on maximum(date+time) field

Status
Not open for further replies.

kskip

MIS
Apr 23, 2003
16
US
Using Crystal Reports 8.5, and ODBC connection to MS SQL tables.

I'm linking two files(an order header file and a line item file linked on order_no using an equals join).

My report is grouped on Order_no.

The table has fields hst_dt and hst_tm.

I am selecting the line item records that have the latest hst_dt (date) and/or (hst_tm)by using a datetime field, with a formula: datetime({table.hst_dt},{table.hst_tm})

Then I have {@datetime} = maximum({@datetime},{table.ord_no}) in the report->selection formula->GROUP

Now I need to be able to get a total for the records that are selected. Is anyone able to help with this?

Karen


 
It sounds like you just need group and/or report totals. Just use the 'Insert Summary' button in the toolbar at the top of the design screen. You can use the wizard to insert totals on groups and totals for the whole report.

All of the date calculations you have done shouldn't affect the ability to get group totals.
 
If you want totals across displayed groups, you will need to use running totals, since inserted summaries will include results for non-group selected records. When using running totals with group selected records, you can just insert the running total and set it to reset on change of group or reset never. If there are no special conditions, just use "evaluate for every record"--it won't include the non-group selected records.

-LB
 
thanks lbass. That got it. I was stuck thinking subtotals etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top