By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,499 Members | 829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,499 IT Pros & Developers. It's quick & easy.

Database query, part of records

P: n/a
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.

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

Help with any part of this would be appreciated.

BR/Peter
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 30 Aug 2004 13:06:33 -0700, pe***@topcom.nu (Peter) wrote:
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.

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

Help with any part of this would be appreciated.


It's an ASP question, but you didn't post to any ASP groups. In fact,
you hit only groups where this would be off topic. Try posting to
microsoft.public.inetserver.asp.db

Jeff
Nov 13 '05 #2

P: n/a
pe***@topcom.nu (Peter) wrote in message news:<f6*************************@posting.google.c om>...
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

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.