Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Displaying query results in a tabular format

Displaying query results in a tabular format

Displaying query results in a tabular format

Hi Everyone,
I have a query that I would like to format in a tabular way. (I'm using MS Access 2010)

This is a snapshot of the table's data:

This is my access query:


SELECT [Income Statement Account Rollup Angelo].[Account Type],
[Income Statement Account Rollup Angelo].ID,
IIf(MonthNo='1',TotalTrans,0) AS Jan,
IIf(MonthNo='2',TotalTrans,0) AS Feb,
IIf(MonthNo='3',TotalTrans,0) AS Mar,
IIf(MonthNo='4',TotalTrans,0) AS Apr,
IIf(MonthNo='5',TotalTrans,0) AS May,
IIf(MonthNo='6',TotalTrans,0) AS Jun,
IIf(MonthNo='7',TotalTrans,0) AS Jul,
IIf(MonthNo='8',TotalTrans,0) AS Aug,
IIf(MonthNo='9',TotalTrans,0) AS Sep,
IIf(MonthNo='10',TotalTrans,0) AS Oct,
IIf(MonthNo='11',TotalTrans,0) AS Nov,
IIf(MonthNo='12',TotalTrans,0) AS Dec
FROM [Income Statement Account Rollup Angelo]; 

This is what I'm getting:

Idealy I would like to see just one line for Account and ID with a value for each month.

What Am I doing wrong here?


RE: Displaying query results in a tabular format

Create a crosstab query with [Account Type] and ID as Row Headings, MonthName([MonthNo]) as the Column Heading, and Sum(TotalTrans) as the value. Set the Column Headings property of the crosstab query to:
Column Headings:"Jan","Feb","Mar",...etc...,"Dec"

Hook'D on Access
MS Access MVP

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close