Try Format(Date,"MM YYYY")
I don't see where you are doing anything with serial number + date! Did I miss something?*Am I doing the serial number + date thing correctly?
I don't see where you are doing anything with serial number + date! Did I miss something?
To back up what Gemma says.although you might think you do, you really dont need (or want) to have a primary key structured in the way you mentioned
have an auotnumber key, which can then be used to link records in other tables - now if you THEN want additional data in the record, such as the date it was created, or a reference number, then add these in as separate fields. (note if it is unique, the reference number could be used as the primary key - but then you will probably get hung up on making a sequence intact, and stuff like that) - the reference number, and date can always be used to sort your data - the primary key is there to link your data tables together
there will be some discussion on here about whether autonumber primary keys are/can be superfluous - all i can say is i tend to use them, and it doesnt hurt.
the thing is not to get to hung about the structure of the primary key - if you are getting concerned, then you are probably talking about attributes of the entity, and not the primary key. - especially if you have repeated segments of the key - in many applications, primary keys would not necessarily be visible to the user, so it doesnt matter what they are!
although you might think you do, you really dont need (or want) to have a primary key structured in the way you mentioned
have an auotnumber key, which can then be used to link records in other tables - now if you THEN want additional data in the record, such as the date it was created, or a reference number, then add these in as separate fields. (note if it is unique, the reference number could be used as the primary key - but then you will probably get hung up on making a sequence intact, and stuff like that) - the reference number, and date can always be used to sort your data - the primary key is there to link your data tables together
there will be some discussion on here about whether autonumber primary keys are/can be superfluous - all i can say is i tend to use them, and it doesnt hurt.
the thing is not to get to hung about the structure of the primary key - if you are getting concerned, then you are probably talking about attributes of the entity, and not the primary key. - especially if you have repeated segments of the key - in many applications, primary keys would not necessarily be visible to the user, so it doesnt matter what they are!
To back up what Gemma says.
The advantages of having an autonumber PK include the following
1. They make it easy when you are adding a new record to the table because the PK is automatically inserted.
2. They are compact compared to alternative ways of having a PK and can be easily (and efficiently indexed).
3. You dont have problems if a decision is made at a later date to change the format of reference numbers etc.
4. There is nothing to stop you having unique reference numbers/codes as well.
How your data appears in your report depends on the formatting of the text box you display it inBut what I have managed to do is to keep "MMYY" as 1 field and "Serial" number as another field. But I am trying to keep both a 1 field MMYY-0000.
The other problem that I am facing now is when I were to try to generate a report from this data.
See the report in the attached.
The Serial Number 0004 becomes 4 and the date became MM/DD/YYYY.
As I managed to set the field for each of the field individually but is there a way to Set the format for these 2 fields?
Thanx in advance.
How your data appears in your report depends on the formatting of the text box you display it in
To get MMYY use something like =Format(Datefield,"MMYY")
To get 0004 use something like =Format(SerNo,"0000")
Hope this helps
Change the data source for your Text13 to =Format([serial id],"0000") & "-" & Format([date mm yyyy],"mmdd")
I have tested this and I think it is what you want.
Goodluck
The person who does the work always hopes to do it the easiest way... But usually it's the person who "sets" the requirements have wonderful hopes for the application.
If they could, they'd wished that the application can help them in the click of a button.