Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
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
Reply With Quote
  #3 (permalink)  
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
Reply With Quote
  #4 (permalink)  
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
Reply With Quote
  #5 (permalink)  
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
Reply With Quote
  #6 (permalink)  
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.