Solved

Access: Create query that displays 2 merged fields

Posted on 2007-11-27
4
195 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

738 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