Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / April 2005

Tip: Looking for answers? Try searching our database.

How to query by date using individual columns for Months?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Don - 07 Apr 2005 18:55 GMT
I am trying to create a query structures the following date:

[problem] [problem_sub_type] [description] [date] [total]
problem1  subtype1                  blahblah      jan      5
problem2  subtype1                  blahblah      jan      12
problem1  subtype1                  blahblah      feb      7
problem2  subtype1                  blahblah      feb      12

I am grouping by problem, problem_sub_type, and description.
I want to have columns in the query for Jan, Feb, Mar, etc. with the totals
by month for each of the unique values that occur when querying using "Group
By"

so the query ends up as:
[problem] [problem_sub_type] [description] [jan] [feb]
problem1  subtype1                  blahblah      5      7
problem2  subtype1                  blahblah      12    12

I can Sum the totals, but haven't been able to sum, using date=jan as a
criteria.  I keep getting an error:

You tried to execute a query that does not include the specified expression
[Date] = Jan as part of an aggregate function.

Also, I have a dataset where a specific problem may not be present for a
given month.  How would that display in this query?  Can I get a 0 to show
for months where a problem doesn't occur?  So jan might show 5, but Feb is 0,
Mar is 12, and so forth.

Thanks for any advice and pointing me in the right direction.

-Don
Don - 07 Apr 2005 19:07 GMT
Looks like a crosstab query was just the thing.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.