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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Month-Year c/w Record Counter Query (MS Access vs Crystal)

Status
Not open for further replies.

0sprey

Technical User
May 9, 2015
81
0
0
CA

I just posted this question in the Access Forum as the data is within a MS Access database. It may be possible to get Access to perform this query however my thinking is that Crystal would be more suited for the job. Would designing this query in Crystal be less complex a task due the additional reporting features Crystal provides ? KMD
=====================================================================================================================================

The 'Parts' Table contains a Date Field called [PURDATE] which contains the date the part was purchased.

I need a query to display parts purchased as a function of year and month of the purchase :

YEAR_MONTH COUNT OF RECORDS
2018-JAN 596
2018-FEB 456


Any thoughts on how best to accomplish this ?

KMD
 
Displaying custom dates in Crystal is generally pretty easy and grouping by that date can be done.. Not sure where the count of records come from though
 
You can use a command and create a query like :
SQL:
select year(<datefield>) & ' - ' & monthname(<datefield>) as year_month, count(*) as count_of_records
from <tablename>
group by year(<datefield>) & ' - ' & monthname(<datefield>)
or
SQL:
select year_month, count(*) as count_of_records
from (
select year(<datefield>) & ' - ' & monthname(<datefield>) as year_month
from <tablename>) t
group by year_month
I am not sure about the exact function names, but you can check them for MS Access.

Using Crystal to group the data is possible , but I doubt it will be easier or faster.

Viewer and Scheduler for Crystal reports, SSRS and Dynamic Dashboards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top