Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

criterea to only return core file numbers?

Status
Not open for further replies.

Lost500

IS-IT--Management
Mar 10, 2009
110
US
Hi everybody,

I'm trying to write a query to only return the 'core' or 'original' records for instance: i have a field called FileNumber and it contains values like

FileNumber:
TX-100
TX-100-A
TX-100-B
TX-500
TX-500-A

the query would only return TX-100 and TX-500 so that i only return the 'core' records or another way to look at it might be only one record for each 'set'. sorry for not knowing the term there but any help would be great!

Thanks so much!
Lost
 



Hi,
Code:
Where Len(Trim(FileNumber))=6


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
If the FileNumbers vary in length then something like:
Code:
group by val(mid(FileNumber,4))
might be a better solution than using a WHERE clause. Even this though relies on the numeric part always starting at position 4 and it's going to be difficult to find a solution that will cope with all possibilities.

Would it be possible to add an extra field to the table so that you can store the core code and the suffix separately? A field in a relational database should only hold one item of information and it's usually a bad sign when you find yourself having to write code to break a field down into small components on the fly.

Geoff Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top