Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access: Create query that displays 2 merged fields

Posted on 2007-11-27
4
Medium Priority
?
205 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 1680 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 320 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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

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…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

730 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