[AccessD] Generating a rownumber field in a query

Jim Hewson JHewson at karta.com
Fri Jun 10 07:42:02 CDT 2005


If the results of the query will be used for a report, you don't need
the sequence number from the query.
Use the Group Header in the report to separate the Cycle numbers.
Put a text box in the detail section with "=1" in the Control Source.
Over Group should designated for the Running Sum.
Each time the report is run, the group sequence number is regenerated...
HTH.
Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bruen, Bruce
Sent: Thursday, June 09, 2005 9:09 PM
To: AccessD at databaseadvisors.com
Subject: [AccessD] Generating a rownumber field in a query

Hi folks,
 
I want to output a sequence number as a field in a query result.
Everytime the query runs it should restart the sequence number from 1.
 
The query appends rows to a "testscript" table, every new test cycle we
generate a new set of test scripts which is made up of all the tests in
the previous cycle plus new tests that were added during the execution
of the last cycle.  The natural key for the output table is the cycle
number + the sequence number.
 
Cycle    Seq    Testname .....   
   1          1        blah
   1          2        blah blah
...
   2          1        blah blah
   2          2        blah blah blah
etc
 
The cycle number is input as a parameter to the append query.  But how
can I generate the sequence numbers?
 
tia
bruce
 
 
This e-mail and any attachments may contain confidential information
that is intended solely for the use of the intended recipient and may be
subject to copyright. If you receive this e-mail in error, please notify
the sender immediately and delete the e-mail and its attachments from
your system.  You must not disclose, copy or use any part of this e-mail
if you are not the intended recipient.  Any opinion expressed in this
e-mail and any attachments is not an opinion of RailCorp unless stated
or apparent from its content. RailCorp is not responsible for any
unauthorised alterations to this e-mail or any attachments. RailCorp
will not incur any liability resulting directly or indirectly as a
result of the recipient accessing any of the attached files that may
contain a virus.
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list