Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 14th, 2007, 07:45 PM
Authorized User
Points: 245, Level: 4
Points: 245, Level: 4 Points: 245, Level: 4 Points: 245, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2006
Location: Houston, TX, USA.
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ricespn
Default Sequential Numbers

Hi,

I'm trying to generate sequential numbers on an Access query, if I have 100 records I would like to add a column that have row 1 trough row 100:

record name

1 mike
2 joe
3 john

I can do it in SQL but I don't know how to do it in Access, I would like to convert this SQL to access:

DECLARE @Seq INT
    SET @Seq = 0254
UPDATE TABLENAME
   SET @Seq = Number = @Seq+1

Thanks

=======================
Strange and crazy, but everything is possible
__________________
=======================
Strange and crazy, but everything is possible
 
Old February 14th, 2007, 07:49 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I'm not sure if this will help, but if you are using this on a report there is a way to generate it on the report, independent of the query. Let me know if this is what you are trying to do, and I'll post the solution, otherwise....

Anyone else have any ideas?

Mike

Mike
EchoVue.com
 
Old February 14th, 2007, 07:52 PM
Authorized User
Points: 245, Level: 4
Points: 245, Level: 4 Points: 245, Level: 4 Points: 245, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2006
Location: Houston, TX, USA.
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ricespn
Default

How can i do it in a report?

=======================
Strange and crazy, but everything is possible
 
Old February 14th, 2007, 08:04 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Alright...

On your report, create an unbound textbox.

Change the Running Sum property (Under the DATA tab) to Over Group or Over All.

That should do it for you!

I got this from the Access CookBook, which I highly recommend if you are working in Access for a significant portion of your job.

Mike

Mike
EchoVue.com
 
Old February 14th, 2007, 08:06 PM
Authorized User
Points: 245, Level: 4
Points: 245, Level: 4 Points: 245, Level: 4 Points: 245, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2006
Location: Houston, TX, USA.
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ricespn
Default

Thanks Mike! :)

=======================
Strange and crazy, but everything is possible
 
Old February 17th, 2007, 02:54 AM
Registered User
 
Join Date: Feb 2007
Location: Ahmedabad, Gujarat, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In order to add Sequential Number into column we have to Insert New AutoIncrement Column in Design View.
After that we need to insert data using SQL.
ie: INSERT INTO <tableName1> VALUES(F1,F2...) as SELECT * from <tableName2>
In above SQL We not need to Insert AutoIncrement Column Name.
The Starting Value of AutoIncrement Field we can set at the Design time while adding a New column using Column Properties.

THANKS,
KNSharma





Similar Threads
Thread Thread Starter Forum Replies Last Post
sequential transformations alexan XSLT 0 July 24th, 2008 11:59 PM
How to have Sequential numbers in a recordset? hman Beginning PHP 1 June 21st, 2008 07:23 AM
Sequential numbering help gear1 Access 1 April 9th, 2007 06:31 AM
Sequential Numbers ricespn SQL Server 2000 14 November 1st, 2006 12:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.