Web Design and Development Forums

Incrementing numbers

This is a discussion on "Incrementing numbers" within the ASP.NET Forum section. This forum, and the thread "Incrementing numbers are both part of the Program Your Website category.

Old Jan 18th, 2008, 09:46   #1 (permalink)
New Member
 
Join Date: Sep 2007
Location: London
Age: 28
Posts: 4
Incrementing numbers

Hi
Looking for a bit of help. I have a request form that when a user opens a new request it populates the ref number straight away. What I'd like it to do it check the db to see what the last number was and increment it by 1 and that is the new ref number, they can then fill it out and submit it.

However there is also another part where if there was an original request that was rejected, a user can go back and re-submit that request with changes however they don't want it to overwrite the original request so what they'd like to happen is the user can search for their previous request and select it. What it needs to do then is take the original ref number, ie 1001 and add an a, b, c etc on the end to show it is a re-submitted request.

I thought about using auto increment in sql however as I've also got to user alphanumeric characters on the ref numbers I don't think this will allow it. I'm a complete newbie so any help would be greatly appreciated

Thanks
RubyRue is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 23rd, 2008, 07:41   #2 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
Re: Incrementing numbers

You could use random function to generate random numbers! Before submiting them to the database, you need to compare the value with what you have in your database to avoid duplication.
Usually, I will stick for the Auto Increment number generated from the database..
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Mar 11th, 2008, 20:06   #3 (permalink)
Junior Member
 
Join Date: Feb 2008
Location: Paris
Age: 31
Posts: 18
Re: Incrementing numbers

what is your database ?
with Oracle, for instance, you could use a sequence and add your alphabetic character at the end of it.
magicben is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Mar 12th, 2008, 03:25   #4 (permalink)
Section Manager - Design Forums
 
frinkky's Avatar
 
Join Date: Oct 2006
Location: Southampton
Posts: 214
Blog Entries: 2
Send a message via MSN to frinkky Send a message via Skype™ to frinkky
Re: Incrementing numbers

Use 2 id's. the overall table id + a support tag id. keep 2 tables (it seems easier in my mind).
Most support ticket systems will not have this random ticket number but a combination of your user id + time/date (for example). Only after its been officially submitted will a random association be attached that can be recalled for further business with it, thats the way to do it (IMO)
__________________
Jon Warner
Section Manager (Design)


Last edited by frinkky; Mar 12th, 2008 at 05:11.
frinkky is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Specific searchable directory, think phonebook with more than numbers AmirKhan Website Planning Discussion 0 May 21st, 2007 19:38
incrementing variables with leading zeros saxman PHP Forum 5 Jan 22nd, 2007 09:48
Problems with random numbers... Pheonix PHP Forum 3 Jan 21st, 2007 23:02
webdesigners with phone numbers contact me jacob Job Opportunities 5 Dec 9th, 2005 09:40
Selecting Numbers WillisTi Flash & Multimedia Forum 1 Nov 16th, 2005 16:56



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 21:54.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59