Results 1 to 3 of 3

Thread: Writing SQL [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Location
    Dreamland
    Posts
    216

    Resolved Writing SQL [RESOLVED]

    I'm using MS Access 2002

    I have a table called Table 1

    In table1 there are colums called "days", "month", & "spent"

    How do i write an sql to view the total sum spent for each month. (the "spent" in my database is filled for each day - so 30days = 30spents * 12 months)


    The output should be just two columns - month & spent. And it should have only 12 rows - January to december.


    I'm using this for now

    Code:
    SELECT Sum(spent) AS January
    FROM table1
    WHERE (((table1.month)="January"));
    But i want all the months in one query.
    Is there a way to get what i want, or is making 12 queries then combining them the only way?
    Last edited by freeze_sr; Aug 1st, 2007 at 08:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width