Solved

Min/Max Date-Time Stamp Sorting

Posted on 1998-12-11
4
284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

751 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