473,382 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to generate a unique Order Number starting with ORD?

The Order Number must be like this:

ORD0000

Thats "ORD" at the beginning followed by 4 numbers, I need to find the max existing Order Number and add 1 to this calculation as well.

So basically I need to know how to make a form automatically generate a new order number starting with ORD but I have to find the max and add 1 on to this to make it unique. Any ideas?
Jan 13 '11 #1

✓ answered by mshmyob

Connor because this is a homework question we do not answer these. You have also asked this same question in another thread and were given pointers.

After trying to do it yourself you can post back your code and we will be happy to help out but we don't do your homework for you.

cheers,

3 2095
orangeCat
83 64KB
First, You need to find the Max(OrderNumber).

A query such as
Select Max(orderNumber) from OrderTable
Jan 13 '11 #2
Because its in a form would I double click on the text box and set the default value as this? & do you know how to make the ORD at the beginning?
Jan 13 '11 #3
mshmyob
904 Expert 512MB
Connor because this is a homework question we do not answer these. You have also asked this same question in another thread and were given pointers.

After trying to do it yourself you can post back your code and we will be happy to help out but we don't do your homework for you.

cheers,
Jan 13 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mullin | last post by:
I need to generate a unique no. in the format like yyyymmddxxxxxx (xxxxxx 6-digitl running number) I think of create a table with two columns date value 20050405 120 20050406 99...
10
by: Mamuninfo | last post by:
Hello, Have any function in the DB2 database that can generate unique id for each string like oracle, mysql,sybase,sqlserver database. In mysql:- select md5(concat_ws("Row name")) from...
1
by: hikums | last post by:
I am posting this here, just in case anyone may need this. Step 1: CREATE SEQUENCE ID_SEQ START WITH 1050000 INCREMENT BY 1 MAXVALUE 9999999 NO CYCLE NO CACHE ORDER
2
by: Chris Dunaway | last post by:
I have a web service which is accessed by a windows forms application. When the application submits a unit of work (a "job"), I want to return a job receipt or tracking number back to the...
28
by: Nina | last post by:
I need to generate unique id for my application. Use system time to create id, which is the best fit, but I don't know how to do it. Please help. Thanks in advance for any input.
16
by: Mark S. | last post by:
I'm a fan of the GUID, but the current project is looking to use a genuinely unique integer. Does the following do that? Math.Abs(System.Guid.NewGuid().GetHashCode()) TIA
12
by: badvoc | last post by:
Hi, I have had some good fortune on this site so I am back and I must iterate I am a beginer. I am having some problems getting to grips with the right technique to manage variables and...
15
by: Ashish Khandelwal | last post by:
As MSDN is not giving us guarantee upon uniqueness of Hash Code, so could any one suggest me that how to generate a unique Hash Code for same string always, and generate different-2 Hash Code...
4
by: gaurav1983 | last post by:
i have to generate unique combinations of given number of digits entered by user eg: N=4 (0,1,2,3) output should be 0 1 2 3
1
by: situ | last post by:
Hi, I'm using DB2 V9 for windows I'm inserting records into DGTT from select statement; the problem is how to insert unique value for every row inserted. I tried using “generated always as”...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.