473,804 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selecting 2 sets of data

I have the following case and need some help ... I need to select two
groups of data based on the time stamp.

Table 1

Card | Date | Time | #1 | #2 | #3
-----------------------------------------------------
1 | 2004-09-09 | 19:39:21 | 841630 | 251534 | 110
2 | 2004-09-09 | 19:39:21 | 895424 | 256112 | 86
3 | 2004-09-09 | 19:39:21 | 895527 | 256881 | 109
1 | 2004-09-09 | 19:49:51 | 841750 | 251545 | 112
2 | 2004-09-09 | 19:49:51 | 895634 | 256173 | 88
3 | 2004-09-09 | 19:49:51 | 895937 | 256885 | 113
1 | 2004-09-09 | 19:59:42 | 841934 | 251554 | 112
2 | 2004-09-09 | 19:59:42 | 895886 | 256182 | 89
3 | 2004-09-09 | 19:59:42 | 896222 | 256892 | 113

I need the latest set of data (time 19:59:42) for all three cards and
then I will need the next previous set of data (time 19:49:51) for all
three cards.

After I have the data, I'll do calculations to arrive at %, etc.

To select the max time, I've tried the following:

select table1.* from table1 left join table1 as t2 on table1.card =
t2.card and table1.time < t2.time where t2.card IS NULL order by
date,time,card;

I don't know how to determine the previous set of data...

Any help would be greatly appreciated.
Jul 20 '05 #1
0 1238

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1334
by: Dave Benjamin | last post by:
Hola, I made a backport of sets.py that will run on Jython 2.1. Here is a diff against the Python 2.3 version of sets.py. The changes were simple, but I may have made a mistake here or there, and since the unit tests depend on generators, it was too much trouble to try to test the module this way. I'd appreciate any help on testing it more thoroughly. So far, everything seems to be working fine. The majority of the changes were due to...
4
5197
by: Sugapablo | last post by:
I have column data that looks like this: id | ColumnA ---+----------- 1 | 12,35,123 2 | 1,23 3 | 233,34,35 4 | 34 And I want to be able to make a WHERE clause where I can match up a
3
4871
by: Mark Wheadon | last post by:
Hello, We have a 'standard letters' type app that can produce the letter as an XSL-FO document. We have used FOP to produce PDFs and are quite impressed. We also need to be able to print the letter and also choose paper from different printer bins. This is mostly so that headed paper can be used for the first page and continuation for the rest. Does anyone know if it is possible to define this with XSL-FO and if FOP, RenderX or...
2
1160
by: Paul Marshall | last post by:
Hi, I'm doing some analysis on a database of log messages and wondered if anyone could help me pull out the data I need (I'm a MySQL newbie) I have the following table called message which contains logged events: +--------------+------------------+------+-----+---------------------+-------+ | Field | Type | Null | Key | Default | Extra |...
1
4099
by: Erik Hendrix | last post by:
Hi, I have some questions related to stripe sets that I'm hoping someone here can answer. 1) What happens to stripe sets when doing a database restore? Do they stay as is? 2) What happens to stripe sets when doing a redirect database restore? Will a new tablespace map be created by this and thus override the existing
48
3884
by: phillip.s.powell | last post by:
MySQL 3.23.58 - 4.0.17 (yep, several database server instances, don't ask) I have database Spring with table Students I have database Summer with table Students I am tasked to produce a query of all students in both tables with no duplicates. No clue whatsoever.
3
2905
by: M.L. Abram | last post by:
Hello all, I do not know if this question is regarding table design, queries, or programming. Below, I have given a table design using Access 2003. Fields 'Product' and 'Color' are primary keys and 'Active' is a Boolean data type. What I am trying to accomplish is having only one record selected active out of the 'Product' field for each type. If possible, have the user be able to do this task while viewing the data within a...
9
1734
by: rickou812 | last post by:
What I am attempting to do is create a form field in which a company name can be selecting from a drop down box. When selecting I want to display the information from my database about the selected company. I am releatively new to php and mysql, but I have learned how to create, input, and display data, but can not seem to figure out how to do the above. I have a page at http://www.cashsurveysnow.com/company.php with examples of a drop...
6
2004
by: rdemyan via AccessMonster.com | last post by:
I don't understand why I can get the following to work: ------------------------------------------------------------------------------ -- SELECT A.*, B.* FROM TableA AS A, TableA AS B IN 'C:\......' WHERE A.USER_ID = B.USER_ID; ------------------------------------------------------------------------------ --
0
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.