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

Compare data between row, move to new table and lastly delete it from old table

50
Hi everyone here,

Wondering if this can be perform in access using SQL or vba.

VesselMovement table:
RNO Date_Fix TIME VID X Y HEADING SPEED
1 07/05/2009 00:00 605 5.1896 6.7198 81 0.3
2 07/05/2009 00:30 605 5.1896 6.7198 90 0.4
3 07/05/2009 01:00 605 5.1847 6.7193 0 4.0
...
10 07/05/2009 18.00 605 5.1956 6.7153 10 9.0
11 08/05/2009 08:00 605 5.2145 6.4533 78 4.0
12 08/05/2009 08:30 605 5.2145 6.4533 56 0.3
13 08/05/2009 09:00 605 5.7892 6.6723 17 0.5
14 03/01/2009 04:00 611 5.7891 6.7893 19 0.4
15 03/01/2009 04:30 611 5.7891 6.7893 21 0.0
16 03/01/2009 05:00 611 5.2345 6.9856 0 0.9

For specific VID on particular day, I need to select:

****check until the last record found for the particular VID on specific day.
**** eg. for 605 on 08/05/2009, if will check until

if SPEED(on row1) <= 0.5 AND SPEED(on row2) <= 0.5 then
if X(row1) = X(row2) and Y(row1) = Y(row2) then
move RNO11 to a new table
delete RNO11 from table VesselMovement

elseif SPEED(on row2) <= 0.5 AND SPEED(on row3) <= 0.5 then
if X(row2) = X(row3) and Y(row2) = Y(row3) then
move RNO12 to a new table.
delete RNO12 from table VesselMovement

Hope to hear from you guys as soon as possible.
Thank you very much.

Regards,
Beemomo
Sep 1 '09 #1
2 1695
ChipR
1,287 Expert 1GB
You should create a recordset and step through it in vba that follows this pseudocode. Let us know if you have trouble with a specific part of this.
Sep 1 '09 #2
ADezii
8,834 Expert 8TB
@beemomo
This is an interesting problem which may require a slightly complex solution. If you are patient (not rushed for a solution), I'll be more than happy to walk you through each step of what hopefully will be a viable solution. On the other hand, if you are pressed for time, I can be of no further assistance to you. Let me know either way.
Sep 1 '09 #3

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

Similar topics

2
by: Sam | last post by:
I have a database that is 70GB big. One of the tables has over 350 million rows of data. I need to delete about 1/3 of the data in that one table. I was going to use a simple delete command to...
1
by: Mark Everett | last post by:
Hi, I am currently running out of space on one of my database servers. Is it possible to move the relevant files for tables onto another drive and instuct MySql to use both folders for it's...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
8
by: Vincent | last post by:
has any one seen a program to compare mdbs'. I have ran into a few of them, but none seem to really do that job. Basically what I need to do is, take 2 access mdb's and check the differences...
8
by: sara | last post by:
I am learning Access and programming. I wanted to have the user select the departments for an ad from the list of all departments. Found code (that I could understand) on this site, and it works....
2
by: codejockey | last post by:
I have a simple project that requires I take a set of data from an Excel spreadsheet, compare it to a table in SQL Server (where column names match), and if there are changes in the Excel sheet,...
9
by: Brad | last post by:
I have written some code to manipulate data/records in a MASTER (order header) and DETAIL (order details) tables. What I have written is too extensive to post but essentially trying to: 1....
1
by: maiami2 | last post by:
Hi Guys, I'm very new to access and I've been trying to get the hang of it over the last few days, but I've become very confused with various aspects of how to code it. Introduction: I am...
0
by: cms3023 | last post by:
I have a DataGrid which displays data with the aid of a procedure. I have tested the procedure inside the database and it is working fine. The table inside the database has data that matches with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.