Solved

Min/Max Date-Time Stamp Sorting

Posted on 1998-12-11
4
278 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now