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

Ticket Differentiation

Status
Not open for further replies.

gennaroalpha7

Technical User
Nov 28, 2012
253
US
Hello -

I have three columns 'CallLog.RecvdDate', 'CallLog.ModDate'and 'Callog.CallId'

My ojective: From today's date - if tickets have been modified from todays date within 3 days to turn green, and tickets that have not been modified and are in the queue for more than 3 days to turn yellow.

My current code, formated in the CallLog.RecvdDate field, is as follows...

Code:


Please check my code and help me improve it to get to my objective. Any suggestions will be appreciated. :)

Thanks.

Alpha7


 
Sorry,

Here's my current code...

Code:
If Date ({CallLog.RecvdDate})> CurrentDate-4 then crAqua

else

If Date ({CallLog.RecvdDate})< CurrentDate-4 then crLime

else
If Date ({CallLog.RecvdDate})= CurrentDate-3 then crYellow
else crNoColor

Thanks.

Alpha7
 
Firstly, the problem with your existing formula is that the 3rd test can never be true and the 4th test will only ever be true if {CallLog.RecvdDate} = CurrentDate-4, because the 1st and 2nd test cover all other possibilities.

Also, if a case never been actioned would that mean the {CallLog.ModDate} would be the same as the {CallLog.RecvdDate}, or would it be null?

The statement of what you are trying to achieve, and the code provided are very different.

Assuming the {CallLog.ModDate} will never be null, the code below will color the text Green when it has been modified within the last 3 days, and Yellow if it was received more than 3 days ago and not actioned within the last 3 days.

Code:
If      {CallLog.ModDate} >= CurrentDate - 3
Then    crGreen 
Else    
If      {CallLog.RecvdDate} < CurrentDate - 3 and
        {CallLog.ModDate} < CurrentDate - 3
Then    crYellow
Else    DefaultAttribute

Does that help?

If that is not what you are trying to do, please explain exactly what you are trying to achieve.

Pease note that there is only value in providing the code you have so far if you explain exactly how the result it returns varies from what you are trying to achieve.


Cheers
Pete
 
Hello Pete -

When I plug in your code...it highlights 'CurrentDate - 3' this part of the code and says 'A String is required here'.

I wanted to describe my columns further, if needed.

I have three columns 'CallLog.RecvdDate', 'CallLog.ModDate'and 'Callog.CallId'.

The 'CallLog.RecvdDate' is when the ticket is received. It is a Date field.

The 'CallLog.ModDate' is when the ticket is updated/modified. It is a Date field.

The 'CallLog.CallID' is the ticket number. It is a number field.



What does 'Else DefaultAttribute' in the code do?


Thanks!

Alpha7




 
Hello -

I solved the 'A String is required here' highlighted problem.

I just had two questions regarding the suggested code.

1. What if the '{CallLog.ModDate}' could be null?

2. What does 'Else DefaultAttribute' in the code do?

Thanks!

Alpha7
[cheers]

 
You could try something like this to deal with null {CallLog.ModDate}s.

Code:
If	Not(Isnull({CallLog.ModDate})) or
	{CallLog.ModDate} <> ''
Then	If      Date({CallLog.ModDate}) >= CurrentDate - 3
	Then    crGreen 
	Else    
	If      Date({CallLog.RecvdDate}) < CurrentDate - 3 and
        	Date({CallLog.ModDate}) < CurrentDate - 3
	Then    crYellow
	Else    DefaultAttribute 
Else	If      Date({CallLog.RecvdDate}) < CurrentDate - 3 
	Then    crYellow
	Else    DefaultAttribute

I have amended the code to deal with dates that are stored as strings, which I seem to recall from earlier posts is the case.

The DefaultAttribute in this case leaves the font colour set at whatever it is in the field format setting (usually black by default). In reality, this is the same as crNoColor.

Cheers
Pete
 
Hello Pete -

Thanks for all your help!

Merry Christmas and a happy 2014! Have a good one!

Alpha7

[santa]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top