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

Auto Numbering Case numbers in 06(year)-0001(case#) format

Cyberdyne
627 Expert 512MB
Hi Guys I am working on a database that will have a locked auto field with the following characteristics. It has to be a number that will be stored in a table, it needs to have the following format 00-0000 , in the actual table it will start with 06-0001 that being 06 is the year then - 0001 being the first case, from then on it will be 06-0002, 06-0003, 06-0004 and so on when next year hits I want the 06 to change to 07-0001 and so on. The reason I am doing this is so that I can implement this into a search criteria in the future. So when I search for 06-0001 the particular case will come up.


So number 1. What should I setup the table/field as? text/number/auto number?

Number 2. How do I make it to automatically have that value increase with each client?

Number 3. Lookin at the long term how can I make it change the year to 07 and the case number to 0001 once 2007 hits?

So what do you think guys?
Sep 29 '06 #1
1 2609
PEB
1,418 Expert 1GB
Hi CyberDyne,

So from the begining... You can't set this field number or Auto number coz there is no possibility to keep the zeros before the number...

Yeah there is a small opportunity to do it using format and validation rules but in this case I suppose that you'll have pb with the research options on this field... For exemple if you want to show all cases from 2006, so you'll type 06* and there will be an error... If it's a number You have to say >59999 and < 70000 as criteria or condition to obtain all from 2006! Is this good way to create your conditions...

AS I see You want to do this field as key of your table without dublicates?

I suggest You to introduce in this code the first 3 or 4 letters of your customer..

And maybe the customer letters is good to preced the year coz the users of the database search a lot by name ... And when then type the first 3 letters all customers with it appears and after you can see the year and additionnal information about the specified customer registration...

In this case your filter that shows all customers from 2006 is

???06*

Elegant isn't it? ;)

What is your opinion about the structure of your key?

Best regards!

PEB
Sep 30 '06 #2

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

Similar topics

3
by: Bryan | last post by:
I am executing a case statement list below, USE Northwind SELECT MONTH(OrderDate) AS OrderMonth, SUM(CASE YEAR(OrderDate) WHEN 1996 THEN 1 ELSE 0 END) AS c1996,
2
by: junkaccount | last post by:
Hello, I currently have a field named QuoteNumber in a table named Quotes. The field is set as autonumber and is used to assign sequential numbers as users enter information in the table through...
7
by: Stinky Pete | last post by:
Hi, The db that's used as our corporate non conformace register, uses a NCF numbering system based on yy-xxxx. The yy is calculated using the year (sorry seems a bit obvious) and the xxxx bit...
8
by: Ryan | last post by:
I have a SQL view that shows data by Category and Year - so the data may look something like this. Category - Year - Amount Fruit - 2006 - $12,000 Fruit - 2007 - $16,000 Vegetables - 2006 -...
0
by: mzladyd | last post by:
This forum has been so helpful to me. Mr Moderator, I know I should at least attempt this myself before asking for help, but I don't know where to begin. My max case 'sql' works fine, but I my 'when'...
8
Scott Price
by: Scott Price | last post by:
Hello Gurus of the Access world... This one has me stumped. I am developing a meal planning database for large functions (1000 people +- for up to 4 days). I have stored base recipes, as well as...
4
by: ataurrehman | last post by:
I want to use select case in a loop as under: Dim i As Integer i = 1 While i < 6 Select Case Field1 Case "Title" strFld(i) = "( & ': ' & )" Case "Author" strFld(i) = "( & ', ' &...
2
by: =?Utf-8?B?Sm9lIFRhdmFyZXM=?= | last post by:
I am using the DateTime.Parse method to parse user entered dates. The dates can be just the year, Month-year and Month-day-year in a variety of formats in a variety of cultures. I immediately parse...
2
by: Irving Guy | last post by:
Hi all, I’m trying to create a form with 15 fields that generates an auto number in one of those 15 fields. The auto generated number which should display like this – “081-2008-00001”...
1
by: Mark A | last post by:
Having looked into this quite a bit I never thought it could be so complicated. I mean, the concept of weeks seems so simple and straightforward, but apparently not. How you number them depends on...
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: 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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...

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.