field calculated....

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

Guest

I am making a query, and I need to calculated a field incremental in the same
query, from 1 to ....number of records like another field, but how can I do
inside the query?
 
Does the result need to be updateable?
Do you have a specific sort order?
Can you provide the sql view so far?
Have you tried to search google or news groups on this?

Normally this can be done with a subquery that counts the records from the
same query/table where the value of a field is less than or greater than the
same field.
 
Does the result need to be updateable? NO
Do you have a specific sort order? YES IN MY TABLE
Can you provide the sql view so far?
THE SQL QUERY IS:

"SELECT respaldo.RECIBO, [value]+1 AS Expr1
FROM respaldo;"

I need a new column in the query that contains a order number from 1 to
.....(records)
 
You don't need to SHOUT. There is no reliable order in a table. You must
have a field or fields in your table that can be used to set the ORDER BY in
your query.

--
Duane Hookom
MS Access MVP


Raul Sandoval said:
Does the result need to be updateable? NO
Do you have a specific sort order? YES IN MY TABLE
Can you provide the sql view so far?
THE SQL QUERY IS:

"SELECT respaldo.RECIBO, [value]+1 AS Expr1
FROM respaldo;"

I need a new column in the query that contains a order number from 1 to
....(records)


Duane Hookom said:
Does the result need to be updateable?
Do you have a specific sort order?
Can you provide the sql view so far?
Have you tried to search google or news groups on this?

Normally this can be done with a subquery that counts the records from
the
same query/table where the value of a field is less than or greater than
the
same field.
 
I'm sorry If I wasn't clear but the problem is this:

In Access 2003 if I try to add a field in the table (design view) like
autonumeric, it fails, I have 182856 records, the error says:
"Se excedio el numero de bloqueos de archivos compartidos, Aumente el valor
de entrada MaxLocksPerFile del registro"

And If I do in Access 97, it works. So thats the reason because I need to
make a query with an autonumeric field calculated, but I don't know the
expression.
Do you know how can I put a temporary field autonumeric in a query?


Duane Hookom said:
You don't need to SHOUT. There is no reliable order in a table. You must
have a field or fields in your table that can be used to set the ORDER BY in
your query.

--
Duane Hookom
MS Access MVP


Raul Sandoval said:
Does the result need to be updateable? NO
Do you have a specific sort order? YES IN MY TABLE
Can you provide the sql view so far?
THE SQL QUERY IS:

"SELECT respaldo.RECIBO, [value]+1 AS Expr1
FROM respaldo;"

I need a new column in the query that contains a order number from 1 to
....(records)


Duane Hookom said:
Does the result need to be updateable?
Do you have a specific sort order?
Can you provide the sql view so far?
Have you tried to search google or news groups on this?

Normally this can be done with a subquery that counts the records from
the
same query/table where the value of a field is less than or greater than
the
same field.
--
Duane Hookom
MS Access MVP


I am making a query, and I need to calculated a field incremental in the
same
query, from 1 to ....number of records like another field, but how can
I
do
inside the query?
 
You can't do this with a query without having a field that represents the
order. I don't understand the error message. Adding an autonumber should
work. Is the file on your local PC? Are you the only user?

--
Duane Hookom
MS Access MVP
--

Raul Sandoval said:
I'm sorry If I wasn't clear but the problem is this:

In Access 2003 if I try to add a field in the table (design view) like
autonumeric, it fails, I have 182856 records, the error says:
"Se excedio el numero de bloqueos de archivos compartidos, Aumente el
valor
de entrada MaxLocksPerFile del registro"

And If I do in Access 97, it works. So thats the reason because I need to
make a query with an autonumeric field calculated, but I don't know the
expression.
Do you know how can I put a temporary field autonumeric in a query?


Duane Hookom said:
You don't need to SHOUT. There is no reliable order in a table. You must
have a field or fields in your table that can be used to set the ORDER BY
in
your query.

--
Duane Hookom
MS Access MVP


Raul Sandoval said:
Does the result need to be updateable? NO
Do you have a specific sort order? YES IN MY TABLE
Can you provide the sql view so far?
THE SQL QUERY IS:

"SELECT respaldo.RECIBO, [value]+1 AS Expr1
FROM respaldo;"

I need a new column in the query that contains a order number from 1 to
....(records)


:

Does the result need to be updateable?
Do you have a specific sort order?
Can you provide the sql view so far?
Have you tried to search google or news groups on this?

Normally this can be done with a subquery that counts the records from
the
same query/table where the value of a field is less than or greater
than
the
same field.
--
Duane Hookom
MS Access MVP


message
I am making a query, and I need to calculated a field incremental in
the
same
query, from 1 to ....number of records like another field, but how
can
I
do
inside the query?
 
I have had this problem also.
I could not add an autonumber field to a table with around 180,000 records
or so.
What you can do is this.
Copy your table structure to a new table.
Add an autonumber field to the new table.
Save the new table, no records added yet.
Create an append query, moving your 182,000+ records to the new table.
Drop all of your fields on to the query and set your sort order.
Run It. The new table will have all of your records in your sort
order, with an auto number field.


Hope this helps

Mike Schlosser


Raul Sandoval said:
I'm sorry If I wasn't clear but the problem is this:

In Access 2003 if I try to add a field in the table (design view) like
autonumeric, it fails, I have 182856 records, the error says:
"Se excedio el numero de bloqueos de archivos compartidos, Aumente el valor
de entrada MaxLocksPerFile del registro"

And If I do in Access 97, it works. So thats the reason because I need to
make a query with an autonumeric field calculated, but I don't know the
expression.
Do you know how can I put a temporary field autonumeric in a query?


Duane Hookom said:
You don't need to SHOUT. There is no reliable order in a table. You must
have a field or fields in your table that can be used to set the ORDER BY in
your query.

--
Duane Hookom
MS Access MVP


Does the result need to be updateable? NO
Do you have a specific sort order? YES IN MY TABLE
Can you provide the sql view so far?
THE SQL QUERY IS:

"SELECT respaldo.RECIBO, [value]+1 AS Expr1
FROM respaldo;"

I need a new column in the query that contains a order number from 1 to
....(records)


:

Does the result need to be updateable?
Do you have a specific sort order?
Can you provide the sql view so far?
Have you tried to search google or news groups on this?

Normally this can be done with a subquery that counts the records from
the
same query/table where the value of a field is less than or greater than
the
same field.
--
Duane Hookom
MS Access MVP


I am making a query, and I need to calculated a field incremental in the
same
query, from 1 to ....number of records like another field, but how can
I
do
inside the query?
 
Back
Top