Combining Fields

G

Guest

I am trying to combine a few fields in a table to show on a form. I was told
on her the other day to not create a new field in the same table with this
combination because it is redundant data. Unfortunately I am having a hard
time with this. The owner of the data base wants a number for each record
and he wants the number to be a combination of 3 fields (two of the fields
that exist in the table plus a third one that is a lookup). So here is the
example:
The first table (the one he want this record number in-well call it "General
Table") has 3 fields (well it has more but for sake of arguement, we will
just talk about the three). They are Project name, unique identifier number
generated by Access( you dbase gurus would call this the primary key i
think), and Date (which is a year value). Project name is a look up from
another table called projects. The projects table has 2 fields: project name
and acronym.
Here is what this guy wants me to do. Create a field in the first table that
is a number he can reference. He wants the number to be the Acronym from the
Projects table + Date from the "General" table+ Unique Identifierfrom Access.
Lets say Project A's acronym is PA. It was started in 2006.
He wants the number to look like this:
PA-2006-04 (where 04 is just the primary key that access assigned to this
row). Is there anyway to do this? I am sure this is not the "correct way"
to be doing this in a database but I have inherited this beast, have to get
this request done by Monday, and really cannot restructure everything. He
wants this type of reference number for each record.
TIA!
 
G

Guest

The data can be combined in a query for use in a form or report.

New Number: [Projects table].[Acronym] &"-"& Year([General].[Date] &"-"&
[YourTable].[YourPrimaryKeyField]

Use the correct table and field names for the data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top