Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. data extraction problem.

data extraction problem.

Scheduled Pinned Locked Moved Visual Basic
databasehelptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LokmanHakim
    wrote on last edited by
    #1

    Hi, Currently i'm developing a system that store inventory record. In my system, i have a database named "rnz.mdb" and it has a table named "recordsList". The PK for the table is FormSerialNumber. The FormSerialNumber is like this --> 68001-001-001. The 1st 5 digit shows the form code.(68001 is the code for inventory form). The 3 digit in the middle is the item ID and the last 3 digits is the number of changes that have been made to the item(for example, computer upgrading). In the field also, there is a field named "Date". My problem is, my boss want the system to display the latest record for each item and at the same time keep the previous record of each of the item. The previous record will became the record's history. I can do the record history part. My problem is the latest record. How can I extract the latest record for each item from the list of records:confused:.

    G 1 Reply Last reply
    0
    • L LokmanHakim

      Hi, Currently i'm developing a system that store inventory record. In my system, i have a database named "rnz.mdb" and it has a table named "recordsList". The PK for the table is FormSerialNumber. The FormSerialNumber is like this --> 68001-001-001. The 1st 5 digit shows the form code.(68001 is the code for inventory form). The 3 digit in the middle is the item ID and the last 3 digits is the number of changes that have been made to the item(for example, computer upgrading). In the field also, there is a field named "Date". My problem is, my boss want the system to display the latest record for each item and at the same time keep the previous record of each of the item. The previous record will became the record's history. I can do the record history part. My problem is the latest record. How can I extract the latest record for each item from the list of records:confused:.

      G Offline
      G Offline
      gpa2000
      wrote on last edited by
      #2

      Try this: Select * from sometable a where a.FormSerialNumber = (Select max(b.FormSerialNumber) from sometable b where a.identifier = b.identifier This way you select the latest record Hope this is the answer to your "VB" guestion Grtz, Guus

      L 1 Reply Last reply
      0
      • G gpa2000

        Try this: Select * from sometable a where a.FormSerialNumber = (Select max(b.FormSerialNumber) from sometable b where a.identifier = b.identifier This way you select the latest record Hope this is the answer to your "VB" guestion Grtz, Guus

        L Offline
        L Offline
        LokmanHakim
        wrote on last edited by
        #3

        thanx...i'll try it

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups