473,588 Members | 2,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Cyberdyne
627 Recognized Expert Contributor
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 2616
PEB
1,418 Recognized Expert Top Contributor
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
7947
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
2743
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 a form. This number is mainly used later as reference when a customer calls our office with questions. We use the quote number to retrieve their related information through a query. This QuoteNumber field is NOT a primary key. It is not...
7
1488
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 is calculated for the next new NCF by adding 1 onto the previously recorded number. What I want to do is enter the main table and manually add a higher number so that when a new procedure is implemented, we are starting from a known entry # and...
8
1671
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 - $15,000 Vegatables - 2007 - $25,000 Say I want to show that data in Tabular view with Category being the Y-Axis and Year being the X-Axis, how would I go about doing this? I'm having a
0
1370
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' statement needs to be dynamic. I am extracting a set of data from Teradata (current year and 2 previous years) and loading it into an Oracle table. The data is in 3 columns so I max case to pivot the table to: EMPNO YEAR1 RATING1 YEAR2 RATING2...
8
1969
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 stored historic data from past years. To generate a shopping list report I am using this sql query: SELECT tblIngredient.ItemName, Sum(tblRecipeIngredient.Quantity) AS TotQuantity, tblMeasureType.MeasureDesc, tblIngredient.RecipeMeasureID,...
4
5680
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
9659
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 out the year case since I can determine that very easily (ie it is 4 digits) and store a boolean to let me know it is just a year. The problem I am encountering is how to tell if a date has been entered with just month year or month day year. ...
2
2516
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” “081-2008-00002” “081-2008-00003” and so on. The first 3 characters of those numbers are pulled in from one of the field, namely “Building #”. The second set of 4 digit numbers are nothing but the current year which gets pulled from another field namely...
1
1196
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 who you talk to, and how you operate. Now Access comes up with a simple way to get week numbers =format(DATE(),"ww") which is apprarently very close to the way ISO 8601 does it, though there are sometimes week 53 anomolies.
0
7929
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8222
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7984
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8223
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5726
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3883
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1458
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.