Solved

Group records with custom yearly grouping

Posted on 2013-07-01
7
472 Views
Last Modified: 2013-07-24
Hi Experts,

I am creating a report where I need to group records yearly but it needs to depend on a specific date.
More in detail, my report is pulling employee records for their hours paid.
I need to show a total of hours paid yearly on the date he/she was hired

So if an employee was hired on 7/1/2010 then it needs to group and total as follows:

Range                                    Total hours paid
======                                  ===============
7/1/2010 - 6/30/2011                    456
7/1/2011 - 6/30/2012                    789
7/1/2012 - 6/30/2013                  1012

If you could guide me to the proper grouping formula I need to create I would really appreciate it

Thank you

CRM
0
Comment
Question by:carlosmonte
  • 3
  • 2
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39291596
How many years are you looking to see?

mlmcc
0
 
LVL 1

Author Comment

by:carlosmonte
ID: 39291610
since the employee started, so date of hire
if they started in 1999 then from 1999 to today
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39291633
Try a formula like this

Local DateVar SaleYearStart := Date({Employee.Hire Date});
Local DateVar SaleYearEnd := Date(DateAdd('yyyy',1,{Employee.Hire Date}) - 1);
While SaleYearEnd < {Orders.Order Date} do
(
    SaleYearStart := Date(DateAdd('yyyy',1,SaleYearStart));
    SaleYearEnd := Date(DateAdd('yyyy',1,SaleYearEnd));
);

CStr(SaleYearStart,"M/d/yyyy") &  " -  " & CStr(SaleYearEnd,"M/d/yyyy")

Open in new window


mlmcc
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:carlosmonte
ID: 39291684
Seems to be working perfectly :)
I will test thoroughly and get back to you asap

Thanks!
CM
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39351313
I've requested that this question be closed as follows:

Accepted answer: 500 points for mlmcc's comment #a39291633

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
LVL 1

Author Closing Comment

by:carlosmonte
ID: 39351314
The solution has worked great.
Thank you mlmcc!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question