Solved

Min/Max Date-Time Stamp Sorting

Posted on 1998-12-11
4
282 Views
Last Modified: 2013-12-25
I have an ODBC Access data source that has data structured in this format:  Product ID, Value 1, Value 2, Value 3, Date-Time Stamp of when values were recorded.  The product ID repeats several times as readings are taken at different times - i.e., I have multiple entries for each ID.  I want to report in summary style, only the minimum and maximum date-time records with associated values in Crystal Reports.  Can anyone provide me an explanation that would allow me to summarize in this fashion?
0
Comment
Question by:mgt4rwg
  • 2
4 Comments
 

Author Comment

by:mgt4rwg
ID: 1498171
Edited text of question
0
 
LVL 5

Expert Comment

by:mayhew
ID: 1498172
Do you want the min and max for *each* product ID?

What version of Crystal are you using and how are you getting your result set (i.e. SQL Query or wizard)?

If you are using a SQL query, please post it and we'll take a look.  :)

However you populate your result set, the answer is going to be along the following idea.  You'll need to add a condition (for example, a where clause at the end of your select) that sets the data equal to the max OR the min.

In pseudo-SQL, something like:

SELECT <data> FROM <table> WHERE <date-time stamp> = (SELECT MAX(date-time stamp) from <table>)
OR <date-time stamp> = (SELECT MIN(date-time stamp) from <table>)

This will grab the high and low regardless of product id.  If you want this info for each product id, it's a little bit more complicated, but still doable.

Again, if you post the info asked for above, maybe we can give you a more concise answer.

Don
0
 
LVL 5

Accepted Solution

by:
AnswerTheMan earned 100 total points
ID: 1498173
from my experoience with crystal reports - if u are not prepared well with your db be4 u go there - it's a waste of time.
do just this : prepare a temporary table with access with all
the records u want to show in the report. (only those u want !!
sort it out yourself in CODE !!!)
then - link crystal to this temporary table. it will work fine.
 
0
 
LVL 5

Expert Comment

by:mayhew
ID: 1498174
AnswerTheMan,

I would agree with you if this were a particularly exotic query.  For this kind of thing, though, I've found Crystal to be adequate.  But whether mgt4rwg does it in Crystal or with code, he/she is probably going to need to know how to do the query.

Even so, instead of a temp table (can you even do that in Access?) I would just set up a query in Access and link to that through Crystal.

mgt4rwg,

If you post the kind of info I asked for above, one of us will be happy to look at it.

Don
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question