Hello all,
I’m currently having an issue with retrieving a unique record from a table that contains "almost duplicates" I mean the table contains valid data but each record is assigned a [Key] which is unique. Here is the table layout (I apologize for the length of the post.)
HSKey --unique key
HSCPMN, --company
HSDIVN, --division
HSVNDN, --vendor
HSPONB, --PO number
HSRVRN, --ref number
HSITMN, --item nbr
HSLNHS, --line nbr
The above fields combined make a unique record without the HSKey)
...
As well as some metric values (not important)
Ok here the thing I need to pull the FIRST UNIQUE record from the table without removing the HSKey field (I need it to refer to another table)
The data result look like this:
HSKey|HSCPMN|HSDIVN|HSVNDN|HSPONB|HSRVRN|HSITMN|HSLNHS
1--------1---------2---------90901----23468----87653----345323----1
2--------1---------4---------33456----99999----12345----324688----1
3--------1---------4---------33456----99999----12345----987688----2
4--------1---------4---------33456----99999----12345----987688----3
5--------1---------3---------23459----65432----34556----757644----1
You can have a record (PO) from a vendor for multiple items; the only thing that makes it unique is the "HSLNHS" the Line number the item was received. Unfortunately I can't use the "line number" field as a WHERE option because the record that contains the needed data it doesn't always have a line number of 1 applied to it ... though it is the FIRST record of the unique record set. Example
HSKey|HSCPMN|HSDIVN|HSVNDN|HSPONB|HSRVRN|HSITMN|HSLNHS
2--------1---------4---------33456----99999----12345----324688----1
3--------1---------4---------33456----99999----12345----987688----2
4--------1---------4---------33456----99999----12345----987688----3
If anybody has any suggestions please let me know...
Thanks
talenx
I’m currently having an issue with retrieving a unique record from a table that contains "almost duplicates" I mean the table contains valid data but each record is assigned a [Key] which is unique. Here is the table layout (I apologize for the length of the post.)
HSKey --unique key
HSCPMN, --company
HSDIVN, --division
HSVNDN, --vendor
HSPONB, --PO number
HSRVRN, --ref number
HSITMN, --item nbr
HSLNHS, --line nbr
The above fields combined make a unique record without the HSKey)
...
As well as some metric values (not important)
Ok here the thing I need to pull the FIRST UNIQUE record from the table without removing the HSKey field (I need it to refer to another table)
The data result look like this:
HSKey|HSCPMN|HSDIVN|HSVNDN|HSPONB|HSRVRN|HSITMN|HSLNHS
1--------1---------2---------90901----23468----87653----345323----1
2--------1---------4---------33456----99999----12345----324688----1
3--------1---------4---------33456----99999----12345----987688----2
4--------1---------4---------33456----99999----12345----987688----3
5--------1---------3---------23459----65432----34556----757644----1
You can have a record (PO) from a vendor for multiple items; the only thing that makes it unique is the "HSLNHS" the Line number the item was received. Unfortunately I can't use the "line number" field as a WHERE option because the record that contains the needed data it doesn't always have a line number of 1 applied to it ... though it is the FIRST record of the unique record set. Example
HSKey|HSCPMN|HSDIVN|HSVNDN|HSPONB|HSRVRN|HSITMN|HSLNHS
2--------1---------4---------33456----99999----12345----324688----1
3--------1---------4---------33456----99999----12345----987688----2
4--------1---------4---------33456----99999----12345----987688----3
If anybody has any suggestions please let me know...
Thanks
talenx