I am working in Crystal 2011. I am extracting data from one table from the Sage CRM database (not sure if it is SQL). The group and sort should go as follows:
So far I have created two formulas:
NumberVar monthValue := (month({table.CreatedDate}));
if(DateDiff("m", {table.CreatedDate}, CurrentDate) < 13) then
cstr(year({table.CreatedDate}),0,"") + "-" + cstr(Monthname(month({table.createdDate})))
else
"no"
The no is used in the select expert to remove any records that is more than 12 months old
My problem is that the dates are not being grouped properly, instead of having the following list
2012-July
Inovices €3423
Payments € 323
2012-Sept
Inovices €3423
Payments € 3234
2012-Oct
Payments €3423
instead i am getting
2012-Aug
Inovices €3423
Payments € 323
2012-Dec
Inovices €3423
Payments € 3234
2012-Nov
Payments €3423
Inovices €3423
Payments € 323
I realise that the date is sorted like this because it takes it alphabetically but how can I sort and group by year and month and display year-Month in the chart?
As you can see in the chart, the dates are not in order and are not grouped properly.
I have restarted this report so many times. I get so far and then it breaks.
Ok , that was a very long winded question but after reading chapter 11 of No Stress Tech Guide AGAIN, I have a better understanding of how the report takes in the data and manipulates it. The report is now grouped into month and sorted to only show records for the last 12 months.
so what did i do ?
So far , so good, just have to tweak it a bit now here is what the finished product looks like.