If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Crystal Reports > Increment a number on max date

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-04-10, 04:54
keithRichards keithRichards is offline
Registered User
 
Join Date: Jul 2010
Posts: 1
Increment a number on max date

Hi all,

I have the following script in my report which increments by 1 - each time a particular vehicle has been into the service department after the specified date criteria. If the same vehicle has been in twice after this date I still only want to count it once. Hence I am trying to only count the max date. At the moment my script is not delivering the correct result because it counts each and every instance the vehicle has been in.

Existing Script

WhilePrintingRecords;
NumberVar CountService;
NumberVar CountReport;
If maximum ({service_Date},{Vehicle_Number}) > Date (2010, 06, 07) then
(CountService := CountRO + 1;
CountReport := CountReport + 1)

A snapshot of what the current result looks like,

Service Date Vehicle Number Count Service
19.04.2010 6FPAAAJG517840 1
11.06.2010 6FPAAAJG517840 2
24.08.2010 ABC12345891111 3

What I am trying to achieve

Service Date Vehicle Number Count Service
19.04.2010 6FPAAAJG517840
11.06.2010 6FPAAAJG517840 1
24.08.2010 ABC12345891111 2

As you can see in the second example only counts the max date.

Any asssistance will be GREATLY appreciated.

Cheers,

KR
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On