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

Group on mov, sort on date

Status
Not open for further replies.

codrutza

Technical User
Mar 31, 2002
357
IE
CRXI

Maybe is a silly question, but I taught I should ask.

I have a group on mov., (on wich I have to do some aggregates), and it shows me:
mov date
Mova 21.03.2012
Movb 30.03.2012
Movc 10.03.2012
...
Is there a way that I can I let the group on mov but sort on date?
mov date
Movc 10.03.2012
Mova 21.03.2012
Movb 30.03.2012
 
Sort by which date? If all items in Mova had the same date, then you could get this result by grouping by "mov" within "date"

Failing that, take a look at TopN.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Sorry, please forget what I wrote.

If a job includes vessel and the job has more than one im/ex mov
then the following rule is applied to determine which im/ex mov is used for the report:
Export jobs
The mov with the latest departure date
Import jobs
The mov with the earliest departure date

Problem: so I have a group by status (Intransit, Scheduled, No status) and I have to follow the rule above. But I don’t know how to do it, because if I make a group by job, the records will be sort by jobs, and in the same time, I need them to be sorted by date, and by vessel.

job mov vessel dep loc dep date arr loc arr date ie
Intransit
100
1002 ar Qingdao 19/02/2012 Dub 17/03/2012 ex
1001 de Singapore 21/02/2012 Dub 19/03/2012 im
101
1011 be Yantian 20/02/2012 Dub 01/04/2012 im
143
1431 be Hong Kong 08/02/2012 Dub 30/04/2012 im
145
1451 ci Yantian 17/02/2012 Dub 02/04/2012 im
150
1501 ae Hong Kong 10/02/2012 Dub 23/03/2012 im
300
3001 br Qingdao 18/02/2012 Dub 28/03/2012 ex

No status
134

190

200


Scheduled
120
1201 ar Yantian 21/02/2012 Dub 12/04/2012 im
180
1801 fe Hong Kong 09/02/2012 Dub 17/04/2012 im
300
3002 no Yantian 19/02/2012 Dub 24/04/2012 im


Finally, I have to have only a record for a job. Is it a way to do that?

If I didn’t explain better, tell me what information should I provide.
 
Crosstabs allow you to show the same data with different groupings in the same report. Does that help?

Note that Crystal has a 'flow', a fixed cycle that you have to slot your own code into. It isn't a full programing language: that's the price you pay for a software tool that can be used to produced a nice-looking report very quickly.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top