Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sum problem

Status
Not open for further replies.

kathyc20

Programmer
Mar 7, 2001
96
CA
I have a table with the fields month which contains every month of the year and a field called personal_month which contains numeric values.

I need to write a query for my form that gives me the sum of all the personal_month records from the kms_table where month=January

example:

=Sum(kms_table.Personal_Month FROM kms_table WHERE(((kms_table.Month)='January')))

This query doesn't work
 
A query would not begin with "=". You can't set a control source to a query or sql statement. Are you attempting to retrieve a value for a control or set the record source of a form?

BTW: I would not store a month name in a field. It is much more flexible and functional to store the month number.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
hi
Code:
Select Sum(K.Personal_Month) 
FROM kms_table K
WHERE(((K.Month)='January')))
But...

what happens next year or is this table only used of one year?

You probably ought to have a Real complete Date instead of just Month.

Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top