1370a Look at previous record for comparison in SQL statements only
Sign Up |  Live StatsLive Stats    Articles 37,349| Comments 177,385| Members 19,423, Newest mohyal| Online 473
Home Contact
 (Forgotten?): 
    Sikhism
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Click Here to Register/Sign Up Daily Hukamnama Member Blogs Downloads Website Navigation Help Fonts Tags
Sikh Philosophy Network » Sikh Philosophy Network » Current News » Information Technology » Look at previous record for comparison in SQL statements only

Look at previous record for comparison in SQL statements only

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 115 USD (23%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Large Hadron Collider has smashed its previous record for particle collisions, CERN Narayanjot Kaur SciTech 0 31-Mar-2010 03:57 AM
Time Comparison Lamya Information Technology 1 28-Jul-2006 08:33 AM
Using a value of a previous record in a report pltaylor3@gmail.com Information Technology 5 28-Jul-2006 08:18 AM
Previous Record on Escape Klingon Coder Information Technology 1 28-Jul-2006 08:16 AM
Re: Get a record from a previous field and insert multiple records David Lloyd Information Technology 2 08-Nov-2005 12:53 PM


Tags
look, previous, record, comparison, sql, statements
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:21 AM
hompie@hotmail.com's Avatar hompie@hotmail.com
Guest
 
Posts: n/a
   
   
Look at previous record for comparison in SQL statements only

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Hi,

I have a recordset with so many differences that distinct or distinct
row will now work.
I want to look at the previous record, and if it's the same except for
some fields, flag it in some way.

The table contains begin and and dates, an employee ID, and where he is
based in main location and sub location, if the main changed, i need to
find those and flag it as INTERNAT_MOVE.

As i'm using Acess pure as an intermediate between an old database and
a new system to convert analyse and flag data and then separate it, i
would prefer to have this is SQL statements, and not in VB, as that
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/11543-look-previous-record-comparison-sql-statements.html
would require a lot more steps.

Except for this single problem I've manaed to (thx to browsing this
group) perform al required translations in SQL, I've been playing with
thislast one but it's friday and i'm running out of time. Just a hint
on where to look for it would be nice. Note that the record nrs are not
really sequential, but the EMP ID is the same, but i can;t do recordID
-1 to search for the previous one

This is it:
Record ID 6 (EMP ID 1) needs to be flagged. Cause the previous record
for employee 1 , record ID 3 the main is different.

EMPID ID start end main sub INTERNAT_MOVE
1 1 01/01/2005 01/05/2005 BE BRUSSELS
2 2 02/01/2005 01/07/2005 BE BRUSSELS
1 3 02/05/2005 30/06/2005 BE ANTWERP
2 4 02/07/2005 31/08/2005 BE ANTWERP
3 5 01/01/2005 03/06/2006 FR LYON
1 6 01/07/2005 01/10/2005 FR PARIS true
2 7 01/09/2005 01/11/2005 BE GENT
1 8 02/10/2005 31/12/2005 FR LYON
1 9 01/01/2006 15/02/2006 SP MADRID

PS: this is fake data, my real table is a lot bigger, and linked, which
is why o made this simplified version just to test it out.

I've added some data which if copied pasted in a text file and imported
gives you some sample data. The first row is the header, separator is ;
, the second colum, ID, is the unique key, EMPID refers to a related
table with single row data of EMP ID.

"EMPID";"ID";"start";"end";"main";"sub";"TYPE"
1;1;1/1/2005 0:00:00;1/5/2005 0:00:00;"BELGIUM";"BRUSSELS";
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11543
2;2;2/1/2005 0:00:00;1/7/2005 0:00:00;"BELGIUM";"BRUSSELS";
1;3;2/5/2005 0:00:00;30/6/2005 0:00:00;"BELGIUM";"ANTWERP";
2;4;2/7/2005 0:00:00;31/8/2005 0:00:00;"BELGIUM";"ANTWERP";
3;5;1/1/2005 0:00:00;3/6/2006 0:00:00;"FRANCE";"LYON";
1;6;1/7/2005 0:00:00;1/10/2005 0:00:00;"FRANCE";"PARIS";"INTERNAT_MOVE"
2;7;1/9/2005 0:00:00;1/11/2005 0:00:00;"BELGIUM";"GENT";
1;8;2/10/2005 0:00:00;31/12/2005 0:00:00;"FRANCE";"LYON";
1;9;1/1/2006 0:00:00;15/2/2006 0:00:00;"SPAIN";"MADRID";"INTERNAT_MOVE"





Got anything to share on This Topic? Why not share your immediate thoughts/reaction with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
How Many Sikhs Have...
Today 21:55 PM
698 Replies, 51,699 Views
Paneer: what I have...
Today 21:50 PM
5 Replies, 53 Views
Woolwich Killing: The...
Today 21:21 PM
19 Replies, 230 Views
Who are Brahmin Sikhs?
By mohyal
Today 20:59 PM
13 Replies, 862 Views
How does Sikhi help you...
Today 18:52 PM
47 Replies, 1,194 Views
Transgenderism ... Right...
By Kaylee
Today 17:55 PM
31 Replies, 1,376 Views
Is Science a Religion?
Today 15:04 PM
12 Replies, 1,994 Views
Rochester Gurdwara...
Today 10:55 AM
2 Replies, 79 Views
US Congress panel passes...
Today 04:22 AM
0 Replies, 41 Views
Harmeet Kaur Took the...
Today 03:40 AM
0 Replies, 64 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 01:43 AM
319 Replies, 7,706 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 00:36 AM
182 Replies, 4,622 Views
Panjabi Alphabet Resource
Yesterday 23:15 PM
12 Replies, 6,559 Views
Biography of a Scholar:...
Yesterday 22:53 PM
1 Replies, 93 Views
Dusting The Web
Yesterday 22:25 PM
0 Replies, 48 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 21:58 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.30052 seconds with 32 queries
0