Combining Text Stings

  • Thread starter Thread starter mcl
  • Start date Start date
M

mcl

I wanted to combine the values in several fields into one in a query (Access
2000). Help said there was a worksheet function concatenate. When I tried it
I got an undefined function error. So what's the story here?
 
"Worksheet function Concatenate" sounds like an Excel function, NOT Access.

The concatenate operator is "&". Try:

SELECT Fieldl & " " & Field2 As Combined
FROM YourTable

See Access Help on concatenation.
 
OK, I approached it just using "&" to combine the fields but now I have
another problem. I have three fields year, mo, day. I wanted to combine them
into one date field. Which I have as mo/day/year using "&" on the fields. I
have them formatted as short date but Access obviously still doesn't know
it's a date. When I sort on it, it just treats it as a text string and sorts
on the first character and even screws up there because of the typical
problem where10,11,12 come before 2-9. How do I get this to work.
 
If the three fields are numeric, you can use the dateserial function
to generate a column that will be of date datatype.

DateField: Dateserial([fldYear], [fldMonth], [fldDay])

--
HTH

Dale Fye


OK, I approached it just using "&" to combine the fields but now I
have
another problem. I have three fields year, mo, day. I wanted to
combine them
into one date field. Which I have as mo/day/year using "&" on the
fields. I
have them formatted as short date but Access obviously still doesn't
know
it's a date. When I sort on it, it just treats it as a text string and
sorts
on the first character and even screws up there because of the typical
problem where10,11,12 come before 2-9. How do I get this to work.
 
Back
Top