Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Selecting the Minimum value for a date and time field

I have selected a field that can often times have three different dates and times associated with it. What I am trying to do is select the earliest or first date and time out of all three and omit the other two dates and times from showing up on the report. Is there any way I can select just the first time and not the other two? Thanks for any help with this!

Former Member
Former Member replied

No problem. You're getting close. You just need to create an incident group on the report.

Without groups your report should resemble this:

ColHead1	ColHead2	ColHead3	ColHead4
---------	---------	---------	---------
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value
Col1Value	Col2Value	Col3Value	Col4Value

Adding a group will have it looking more like this...

IncidentGroup 1
	ColHead1	ColHead2	ColHead3	ColHead4
	---------	---------	---------	---------
	Col1Value	Col2Value	Col3Value	Col4Value
	Col1Value	Col2Value	Col3Value	Col4Value
	Col1Value	Col2Value	Col3Value	Col4Value
	Col1Value	Col2Value	Col3Value	Col4Value

IncidentGroup 2
	ColHead1	ColHead2	ColHead3	ColHead4
	---------	---------	---------	---------
	Col1Value	Col2Value	Col3Value	Col4Value
	Col1Value	Col2Value	Col3Value	Col4Value
	Col1Value	Col2Value	Col3Value	Col4Value
	Col1Value	Col2Value	Col3Value	Col4Value

IncidentGroup 3
	ColHead1	ColHead2	ColHead3	ColHead4
	---------	---------	---------	---------
	Col1Value	Col2Value	Col3Value	Col4Value
	Col1Value	Col2Value	Col3Value	Col4Value
	Col1Value	Col2Value	Col3Value	Col4Value
	Col1Value	Col2Value	Col3Value	Col4Value

Now assume in this instance that each "IncidentGroup" is it's incident code and the details below are the individual responses.

Also assume that the response details are sorted in order by date/time in ascending order.

Based on that you're saying, you only want the "first" detail record for each group...

To get that, simply move the field from the details section to the "IncidentGroup" header. (Not the page header or report header)

-- Note: moving the fields to the group footer will give you the last record in the group...

Now, to get rid of the records that you don't want to see, suppress the details section. You'll have something that looks like this...

IncidentGroup 1 1stIG1Col1Value	1stIG1Col2Value	1stIG1Col3Value	1stIG1Col4Value	

IncidentGroup 2 1stIG2Col1Value	1stIG2Col2Value	1stIG2Col3Value	1stIG2Col4Value

IncidentGroup 3 1stIG3Col1Value	1stIG3Col2Value	1stIG3Col3Value	1stIG3Col4Value

Reread my last post and follow all 5 steps. They still apply to your described scenario.

Jason

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question