473,396 Members | 1,838 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,396 software developers and data experts.

Unique OrderId number Help

Ken
I am trying to create an order id that is as follows
ymm-000 this would be 501-001 the first record for Jan 2005
502-001 the first for Feb 2005 and so on.
Any help would be appreciated

Thanks
Ken

Nov 13 '05 #1
1 1149

"Ken" <ke******@yahoo.com> wrote in message news:11*********************@c13g2000cwb.googlegro ups.com...
I am trying to create an order id that is as follows
ymm-000 this would be 501-001 the first record for Jan 2005
502-001 the first for Feb 2005 and so on.
Any help would be appreciated

Thanks
Ken


try this (break it down in sections (noted by ampersands) when you try it, so you can slowly built it up and see if it works for
you. It shows 001 as the first order of that day and 002 as the second order of that day - if the numbers are sequential (i.e. 1,2
3,4,5,6,7,, etc..)

Make sure to replace the name of the table and field with your own.

Any questions, please ask.

right(Format(Date(), "yyyy"), 1) & format(date(), "mm") & format((dlookup("[ID]", "[orders]", "int([orders]![orderdate])="
int(date() )-dmin("[ID]", "[orders]", "int([orders]![orderdate])=" int(date() )+1)), "000")

- Nicolaas
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rick Clift | last post by:
I have two tables in my database called CartItems and OrderItems. I store all of a session's shopping cart items in the CartItems table using the sessionID as the identifier (called cartID in my...
0
by: web1110 | last post by:
Hi y'all, I was playing with the NorthWind database, displaying subtables in a DataGrid. It worked fine for 3 levels, but when I added a fourth, I got the following error: These columns...
18
by: JJ | last post by:
Now I know this question has been asked many times, but I cannot seem to find a good site which summarises the methods possible in vb .net. I am after a way of producing a unique serial number...
2
by: pstachy | last post by:
Hi again! I have another issue. I would like the attribute of the tag <invoice> to be unique. Made the following schema but unfortunately it doesn't validate. Could someone please indicate what is...
6
by: Paul Bromley | last post by:
Ok - I have given up on trying to find the active IP address for a given PC. For licensing purposes I need to retrive a unique identifier from the PC that the program is installed on. The Hard disk...
4
by: awcem | last post by:
I am working with Microsoft access 2003 i have a continuous form which shows summary date for purchase orders. This form is based on a query which looks at the Purchase Orders table and the Purchase...
2
by: srusskinyon | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
1
by: ramdil | last post by:
Hi All I have got a lots of help from this forum and again i am in need of yours help. I will briefly explain the scenario.I have a customer table.It was created 12 years ago and its Primary key...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.