concatinate in table or query

G

Guest

Is there anyway to create a field that concatinates another field in a table.
Specifically I have 2 fields. The first one has text something to the effect
of Project XYZ. What I would like to do is have another field in the table
that would just show Project XY and leave off the Z. I want to do this
because I want to sort this way. So I guess the next question is should I do
this in a query and if so, how? If Field 1 has text in the following rows:
Project ABC, Project AB, Project XY, and Project XYZ and I want to sort (and
sum) all data by the first two project numbers (i.e., project ABC and Project
AB are summed together) how would I do this? Thanks in advance!
 
G

Guest

You seem to be asking several questions together, so I'll try to answer them.

To concatonate two fields in a query, go to a clean cell in the QBE and
enter something like:
ConcatField: field1 & field2
if you had data as follows here's what you'd get:
field1 field2 ConcatField
==== ==== ========
aaa bbb aaabbb
123 456 123456

You get the idea.

It sounds, however that you want to do the opposite, namely you have a
project AB that includes a subproject ABC. I'll assume you may also have
ABD, ABE, etc. In a query you would include the full project id (e.g. ABC)
and then a field defined as

MajorProj: Left(project,2)

That would give you rows something like this

Project MajorProj
===== =======
AB AB
ABC AB
ABD AB

And so forth. Within that structure, you can then sort and sum in either a
query or report to present the data for each project (ABC, ABD, etc.) and sum
all to the Major Project (e.g. AB).

Hope the above helps.
 

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