473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Query max records

Hi all,

I'm new to Access and am seeking advice on a query. I have a table of observed hourly tide data. I would like to query out the high tides for each day (2X/day). Each record is one hours data (24 records/day). Any suggestions on comparing each record to the previous and following records to determine the high points?

Any help is appreciated.
Feb 29 '08 #1
3 3123
Stewart Ross
2,545 Expert Mod 2GB
Hi all,

I'm new to Access and am seeking advice on a query. I have a table of observed hourly tide data. I would like to query out the high tides for each day (2X/day). Each record is one hours data (24 records/day). Any suggestions on comparing each record to the previous and following records to determine the high points?

Any help is appreciated.
Hi Inferno. Excel is much better suited to the task than Access. Although it is possible to generate an SQL query which will give the kind of next and last comparison you require it is a distinctly non-trivial task, involving self-joining two copies of the hourly table to itself where the joins are on the day ID and (hour-1) in one case, and the day ID and (hour+1) for the other.

It is much, much easier to perform such analysis in Excel instead, where it is just a few minutes work to set up this kind of last-and-next comparison.

-Stewart
Feb 29 '08 #2
Hi Inferno. Excel is much better suited to the task than Access. Although it is possible to generate an SQL query which will give the kind of next and last comparison you require it is a distinctly non-trivial task, involving self-joining two copies of the hourly table to itself where the joins are on the day ID and (hour-1) in one case, and the day ID and (hour+1) for the other.

It is much, much easier to perform such analysis in Excel instead, where it is just a few minutes work to set up this kind of last-and-next comparison.

-Stewart
Thanks for the insight Stewart. Unfortunately, the file is far too large for Excel to handle (15 years worth of hourly data). I'll give self-joining the tables in Access a try.
Feb 29 '08 #3
NeoPa
32,556 Expert Mod 16PB
One of the fundamental principles of SQL is that the records are in no particular order. They can be sorted by various keys, but there are no relative processing keywords available. Aggregate functions (Min(), Max(), First(), Last() etc) are supplied, but that is the limit of the ability to access progressive records.

VBA recordset coding may well be a more profitable line for you to explore here. This can do what you need, fairly straightforwardly. It's not as efficient (processing or time wise) as basic SQL though, so be warned.
Mar 7 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Steve | last post by:
Form FrmRestock's recordsource is QryFrmRestock. The TransactionDate field's criteria is set ats: Forms!FrmRestock!LastXDays. LastXDays on the form is a combobox where the selections are 30, 60...
3
by: Tom Mitchell | last post by:
All: I'm stumped on a query. How do I find duplicates in a table where one of the duplicates has values is a certain field and the other doesn't. For example, I have the following table: ...
5
by: Daniel Tan | last post by:
Are there anyway to copy rows of records from one query to another query and then hide the records in source query ? Pls advise. Thanks. Regards, Daniel
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
6
by: Sven Pran | last post by:
Probably the answer is there just in front of me only awaiting me to discover it, but: 1: I want to build a query that returns all records in one table for which there is no successful "join"...
4
by: Brian | last post by:
I hope this will make sense. I'm trying to filter the records in a table based on records in a 2nd table. The trick is, I can't use a query. I'm trying to filter down the number of records going...
1
by: VMI | last post by:
I need to display Access data in a datagrid but the Access table has over 2 million records. Since I can't fill a datatable with all those records but the user needs to see all of them, how can I...
2
by: Fendi Baba | last post by:
I created a person table with various fields such as Suffix, Salutation, etc, Some of these fields may not be mandatory for example suffix. In the actual table itself, I only have a field for...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
5
by: slickdock | last post by:
I need to break my query into 3 groups: First 60 records (records 1-60) Next 60 records (records 61-121) Next 60 records (records 122-182) Of course I could use top values 60 for the first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
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...

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.