Access SQL JAN FEB MAR

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
AkazukinAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
peter57rConnect With a Mentor Commented:
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"


0
 
peter57rCommented:
SHould have said that for the crosstab query you select the first query as the source.
0
All Courses

From novice to tech pro — start learning today.