Solved

Access: Create query that displays 2 merged fields

Posted on 2007-11-27
4
199 Views
Last Modified: 2010-03-20
I have a table (Name:"dates" Columns: "Month", "Year")

In query mode, if I choose the table above as the source, how would I create a field that would be a combination of the "Month" and "Year" Fields.

i.e.  Insert this into  a new field in query view----> MonthandYear: [Month]+""+[Year]

In other words how do I make the syntax above work?
0
Comment
Question by:ouestque
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20359476
select  [Month]&" "&[Year] from tableName  

0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 420 total points
ID: 20359493
if you don't want a space in between

select  [Month],[Year], [Month]&[Year] as MonthAndYear from dates  
0
 
LVL 40

Assisted Solution

by:Richard Quadling
Richard Quadling earned 80 total points
ID: 20359565
In SQL server, & doesn't cut it.

Try ...


SELECT CAST(Month AS VarChar) + CAST(Year As VarChar)

So, watch out for portability of any query you write.
0
 

Author Comment

by:ouestque
ID: 20361444
Thanks guys!!! Caps solution worked and he had the first response, but RQuadling had a SQL compabaility solution. Cap gets majority points., but RQ gets a little to for the effort.

Thanks again!!!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question