🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-access
Article #489

Re: Database query, part of records

#489
From: Pieter Linden
Date: Tue, 31 Aug 2004 03:13
29 lines
1797 bytes
peter@topcom.nu (Peter) wrote in message news:<f6c505b5.0408301149.6e21dbb@posting.google.com>...
> Hello!
> I have some records in a database (access), like this:
> 
> 001111-10
> 001111-11
> 001111-12
> 002222-10
> 002222-11
> 002222-12
> 
> I need to retrive the first record of each sequence, "001111-10" and
> "002222-10" in the example above.

SELECT Left$([Recno],6) AS SeqNo, First(Table1.RecNo) AS FirstOfRecNo
FROM Table1
GROUP BY Left$([Recno],6);

> Next part is I need to show only the first part of each record,
> "001111" and "002222" on an Active Server Page (ASP).

SELECT Left$([Recno],6) AS SeqNo
FROM Table1
GROUP BY Left$([Recno],6); 


> Help with any part of this would be appreciated.
> 
> BR/Peter
Technical Details
Message-ID: <bf31e41b.0408301913.2359d91b@posting.google.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews2.google.com!not-for-mail
References: <f6c505b5.0408301149.6e21dbb@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: ff0ac,fe8adce8f4807dcf
X-Google-Thread: 10ef2d,fe8adce8f4807dcf
X-Google-Thread: f4d39,fe8adce8f4807dcf
X-Google-Thread: 1131db,fe8adce8f4807dcf
X-Google-Attributes: gidff0ac,gid10ef2d,gidf4d39,gid1131db,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews2.google.com!not-for-mail
From: pietlinden@hotmail.com (Pieter Linden)
Newsgroups: comp.databases.ms-access,forum.sqlbase,microsoft.public.inetserver.iis,mailing.database.sql-general
Subject: Re: Database query, part of records
Date: 30 Aug 2004 20:13:55 -0700
Organization: http://groups.google.com
Lines: 29
Message-ID: <bf31e41b.0408301913.2359d91b@posting.google.com>
References: <f6c505b5.0408301149.6e21dbb@posting.google.com>
NNTP-Posting-Host: 64.24.186.111
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1093922036 5287 127.0.0.1 (31 Aug 2004 03:13:56 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 31 Aug 2004 03:13:56 +0000 (UTC)