Full Version: Query multiple fields to one
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
boxofrox
I need to query 3 fields (length, width and thickness) into one. Currently the three fields are part of a very large query through which I generate a report. Do I need a separate query to build this and then include that query in the final larger query? or is there a way to include it in the current query? (was that confusing enough for everyone???)

Cindy
danishani
hi Cindy,

Well, u can add them together in your report, which probably a easy way:

In an unbound textbox u can do something like this, do u want to seperate them by a space or do u want them all together in one line:

all seperated with a space:
=[length]&" "&[width]&" "&[thickness]

all without a space:
=[length] & [width] & [thickness]

HTH
Daniel
boxofrox
So basically I can leave the query the way it is and just combine them in the report - I knew it was absurdly simple... must have more coffee.


Thanks!

Cindy
danishani
Cindy,

Yes, well u can do it a query, but can give some trouble if its all combined from a lot of calculations, so in this case its maybe better to do this in your report.

Daniel
boxofrox
Need more braincells to go w/ the coffee: where does the code string go?
preston
Place his recommended string:

=[length]&" "&[width]&" "&[thickness]

in the Control Source of the textbox you want to show it. frown.gif

You in Las Vegas or Reno?
boxofrox
I'm in Vegas - I'm getting a very strange string in the textbox after I put this code in. I put in three arbitrary numbers in Length/Width/Thickness - 2/3/1 - and I get 2 x 4050 x 1

Ideas?

Cindy
preston
Can you attach a sample database?

I'm in Las Vegas as well.
boxofrox
Well the db is very large. The field actually exists in a subreport.
Table - Query - Form - Subreport
The fields are text fields. There are no other code strings operating w/in the subreport.

hope this helps
preston
Is the field named Width? It may be a reserved word. Maybe try changing that field name?
boxofrox
Yup! That was the problem - thank you so much. Where are you in NV?
preston
I live on Silverado Ranch, Work over off Sunset by the Airport.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.