Increment a single column?

  • Thread starter Thread starter Noozer
  • Start date Start date
N

Noozer

Just wondering if there is a simple way to do this...

I have an MS Access table that I'm using from an ASP page. It's quite
simple... Just one row with six columns. I want to be able to specify a
column and increment the value in that column.

Something like this.. I want to increment the value in column three:

UPDATE Counters Set [3] = [3]+1 ;

Thanks!
 
Do you not know the name of the field? As far as I know, you cannot refer to
a field by its ordinal position in a SQL statement, other than in the ORDER
BY clause.
 
Can you alter the table structure to become 2 columns, with 6 rows. Use 1
column for the Column Names you are currently using, and the second as your
counter. Then you are able to identify which row to update.

Sharkbyte



Douglas J Steele said:
Do you not know the name of the field? As far as I know, you cannot refer to
a field by its ordinal position in a SQL statement, other than in the ORDER
BY clause.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Noozer said:
Just wondering if there is a simple way to do this...

I have an MS Access table that I'm using from an ASP page. It's quite
simple... Just one row with six columns. I want to be able to specify a
column and increment the value in that column.

Something like this.. I want to increment the value in column three:

UPDATE Counters Set [3] = [3]+1 ;

Thanks!
 
I was able to modify my coding to pass proper column names instead of their
ordinal index.

It's working fine now.

Sharkbyte said:
Can you alter the table structure to become 2 columns, with 6 rows. Use 1
column for the Column Names you are currently using, and the second as your
counter. Then you are able to identify which row to update.
Douglas J Steele said:
Do you not know the name of the field? As far as I know, you cannot refer to
a field by its ordinal position in a SQL statement, other than in the ORDER
BY clause.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Noozer said:
Just wondering if there is a simple way to do this...

I have an MS Access table that I'm using from an ASP page. It's quite
simple... Just one row with six columns. I want to be able to specify a
column and increment the value in that column.

Something like this.. I want to increment the value in column three:

UPDATE Counters Set [3] = [3]+1 ;

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top