473,382 Members | 1,437 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,382 software developers and data experts.

Lead or Lag SQL options available?

I need to know if the Lead or Lag SQL options are available in MS Access. I have a need to use them to determine if data is different on the next day or previous day. The reason I need this is to limit data being moved over the network by not sending duplicate data and having the program assume that the day after data is the same. For example:

Original Datset
Start Date UserID WorkType Start_Time End_TIme
10/02/2007 1234 SHIFT 08:00AM 03:00PM
10/03/2007 1234 SHIFT 08:00AM 03:00PM
10/04/2007 1234 SHIFT 08:00AM 12:00PM
10/05/2007 1234 SHIFT 08:00AM 03:00PM
10/06/2007 1234 SHIFT 08:00AM 03:00PM
10/07/2007 1234 SHIFT 08:00AM 03:00PM
10/08/2007 1234 SHIFT 08:00AM 10:00AM

Passed Dataset
Start Date UserID WorkType Start_Time End_TIme
10/02/2007 1234 SHIFT 08:00AM 03:00PM
10/04/2007 1234 SHIFT 08:00AM 12:00PM
10/05/2007 1234 SHIFT 08:00AM 03:00PM
10/08/2007 1234 SHIFT 08:00AM 10:00AM

This eliminates the need to send unneeded data over the network since it is already being passed.

I am having trouble think of a way to do this without the lag and lead functions that SQL offers, but can not find a way to do it in ol' MS Access.

Any help would be greatly appreciated.
Nov 17 '07 #1
1 11197
ADezii
8,834 Expert 8TB
I need to know if the Lead or Lag SQL options are available in MS Access. I have a need to use them to determine if data is different on the next day or previous day. The reason I need this is to limit data being moved over the network by not sending duplicate data and having the program assume that the day after data is the same. For example:

Original Datset
Start Date UserID WorkType Start_Time End_TIme
10/02/2007 1234 SHIFT 08:00AM 03:00PM
10/03/2007 1234 SHIFT 08:00AM 03:00PM
10/04/2007 1234 SHIFT 08:00AM 12:00PM
10/05/2007 1234 SHIFT 08:00AM 03:00PM
10/06/2007 1234 SHIFT 08:00AM 03:00PM
10/07/2007 1234 SHIFT 08:00AM 03:00PM
10/08/2007 1234 SHIFT 08:00AM 10:00AM

Passed Dataset
Start Date UserID WorkType Start_Time End_TIme
10/02/2007 1234 SHIFT 08:00AM 03:00PM
10/04/2007 1234 SHIFT 08:00AM 12:00PM
10/05/2007 1234 SHIFT 08:00AM 03:00PM
10/08/2007 1234 SHIFT 08:00AM 10:00AM

This eliminates the need to send unneeded data over the network since it is already being passed.

I am having trouble think of a way to do this without the lag and lead functions that SQL offers, but can not find a way to do it in ol' MS Access.

Any help would be greatly appreciated.
To the best of my knowledge, there is no equivalent functionality to SQL's Lead and Lag Functions in Access SQL. Off the top of my head, I would create a Nested Loop representing the Original Recordset (Table) and a Clone comparing data in every other Field other than Date for equivalency. If the data were equivalent, it would be ignored, if not it would be written to a sort of holding Table where a SQL, Statement would retrieve it. I'll hold off on this approach since there is probably a better answer out there from a Moderator/Expert, but I'll keep an eye on this Thread.
Nov 18 '07 #2

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

Similar topics

12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
1
by: comp.lang.javascript | last post by:
Using IE5.5+, is it possible to hide options in a select? The following doesn't work: <HTML> <HEAD> <STYLE> SELECT OPTION.orgA{ display:none } .orgB{ display:inline } .orgC{ display:none }
2
by: ashkaan57 | last post by:
Hi, I have two listboxes and want to move a set of selcted items from the listbox on the left moved to the listbox on the right when a button is pressed: function RightButton_OnClick() {...
3
by: Tony Kim | last post by:
Hi everyone, i have an assignment that needs immediate attention and was hoping i would be able to get some help here. im trying to create 3 option boxes that are linked together. for...
12
by: Russ | last post by:
I'm interested in setting up a web page where live data can be displayed in real-time on the web page. For example: I would like to display a (nice looking) graph of some data value versus time...
3
by: joni b | last post by:
I need help limiting the options shown in a combo box. I have two combo boxes that appear in a datasheet view subform. The form looks like an Excel spreadsheet, which is what the user prefers....
2
by: Samuel R. Neff | last post by:
What options are available for doing full-text searches of database data without using a database-specific full-text engine? The only option I've found is Google's Search Appliance but it's an...
2
by: shankwheat | last post by:
I have a form named 'choiceForm' and 2 select boxes named 'available' and 'move'. I give users the ability of copying options (not moving) from available to move with the code below. I would like...
0
by: Crispy Beef | last post by:
Hi, I've built a number of online shops with but I want to increase the flexibility of the system that I use, mainly relating to product options. Currently I just use an admin area to assign...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.