My Table :

Name ---- Birthday Date
John  ----- 01/JAN/1960
Mark ----- 02/Feb/1961

I wish my access query to show :

Name ---- JAN---FEB---MAR
JOHN ----- 01 -----------------
MARK -------------- 02 --------

My current SQL which cannot work :

Select Name, month(Birthday)=1 as JAN, month(Birthday)=2 as FEB from People;

Please help
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

To do this you would need two queries.

The first query would be used to re-structure the data into a form that is usable by the second query.

The second query would be a crosstab query with pre-defined column headings.

The first query ...

Select [Name], format([Birthday Date], "MMM") as BMonth, Day([Birthday Date]) as BDay
From tablename;

For the second query use the crosstab wizard and create the query.  This will initially show the months in alphabetical order.
In the query properties set the Column Headings property to the month names in the correct sequence.

"JAN","FEB", "MAR"  etc to "DEC"


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SHould have said that for the crosstab query you select the first query as the source.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.