Autonumber in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating a table using query, but what I need is an autonumber field
that with increment up when a particular feild is blank. Not all records
that have this field will have a null value. But I only want the ones that
have a null value to have an autonumber. Is this possible? Thanks stacie
 
Hi,


Why not having an autonumber in each record, and read it / use it, or
not, ONLY if the "other" field is null, or not? Sounds easier to me.


SELECT iif(otherField IS NULL, myAutonumber, otherField ) As
OccasionalAutonumber, ....
FROM myTable


and use that query rather than the original table (when appropriate).

Hoping it may help,
Vanderghast, Access MVP
 
Back
Top