Re: Sorting field after getting distinct elements in access?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"raman" <anusha.ramanujam83@xxxxxxxxx> wrote in message
news:1179514905.446392.4160@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have a field called Item and an autonumber field. i tried to get the
distinct number of items using the following query:
Set rcdset = Db.OpenRecordset("select distinct Items from tablename")
i want to sort this by autonumber.
so i have it as
Set rcdset = Db.OpenRecordset("select distinct Items from tablename
order by autonumber")
but this gives an error.
Any help?

Use the field *name* of your autonumber field.

It's not likely your column is named "autonumber". If it IS named
autonumber, you should rename it because AutoNumber is a special kind of
data type for Access tables and I can certainly see a field named that
causing problems. I'd be VERY surprised if Access permitted you to name a
field "autonumber" to be begin with.

--
Mike
Microsoft Visual Basic MVP


.



Relevant Pages

  • Sorting field after getting distinct elements in access?
    ... I have a field called Item and an autonumber field. ... Set rcdset = Db.OpenRecordset("select distinct Items from tablename") ...
    (microsoft.public.vb.general.discussion)
  • Re: Specific "auto numbers" possible?
    ... ineveitably arise when using autonumber. ... Create and run an append query to append the temporary table to the ... New on the Database window toolbar. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Specific "auto numbers" possible?
    ... ineveitably arise when using autonumber. ... Create and run an append query to append the temporary table to ... New on the Database window toolbar. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Specific "auto numbers" possible?
    ... ineveitably arise when using autonumber. ... Create and run an append query to append the temporary table to the ... New on the Database window toolbar. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Specific "auto numbers" possible?
    ... ineveitably arise when using autonumber. ... Create and run an append query to append the temporary table to the ... New on the Database window toolbar. ...
    (microsoft.public.access.tablesdbdesign)