Increment a single column?

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!
 
D

Douglas J Steele

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.
 
S

Sharkbyte

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!
 
N

Noozer

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!
 
Top