wilekoyote76
MIS
I'm working on a formula that is not calculating all the fields properly. What I am trying to do is calculate the days since the last action on a contact and below I have the code for it.
CONTACT2.UDATERECD=Date ticket was opened
CONTACT2.URIDATREC=Reinspect the ticket for problems
CONTACT2.URODATREC=Reopen the ticket for various reasons (not problem related)
CONTACT2.USTATREP=Status was updated on this date
Status date can be newer than RI or RO date.
RI or RO can be newer than Status date
Nothing newer than when ticket opened for daterecd field
I'm having a problem getting all the days since last action formula I created to calculate all the filtered records. Any suggestions? I've commented out the code that I originally had in. I am new to crystal.
If (not(isnull({CONTACT2.URIDATREC})) or not(isnull({CONTACT2.URODATREC}))) then
If not(isnull({CONTACT2.URODATREC})) then
If {CONTACT2.URODATREC} >= {CONTACT2.UDATERECD} then
If {CONTACT2.URODATREC} >= {CONTACT2.USTATREP} then
numberVar Days_Since_Action2 :=DateDiff ("d", {CONTACT2.URODATREC}, CurrentDate)
Else
numberVar Days_Since_Action2 :=DateDiff ("d", {CONTACT2.USTATREP}, CurrentDate)
Else -98
Else If not(isnull({CONTACT2.URIDATREC})) then
If {CONTACT2.URIDATREC} >= {CONTACT2.UDATERECD} then
If {CONTACT2.URIDATREC} >= {CONTACT2.USTATREP} then
numberVar Days_Since_Action2 :=DateDiff ("d", {CONTACT2.URIDATREC}, CurrentDate)
Else
numberVar Days_Since_Action2 :=DateDiff ("d", {CONTACT2.USTATREP}, CurrentDate)
Else -99;
If {CONTACT2.USTATREP} >= {CONTACT2.UDATERECD} then
numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.USTATREP}, CurrentDate)
Else numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.UDATERECD}, CurrentDate);
//Else
// If not(isnull({CONTACT2.URODATREC})) then
// If {CONTACT2.URODATREC} >= {CONTACT2.UDATERECD} then
//Else If {CONTACT2.USTATREP} >= {CONTACT2.UDATERECD} then
// numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.USTATREP}, CurrentDate)
// Else numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.UDATERECD}, CurrentDate);
//If {CONTACT2.URIDATREC} >= {CONTACT2.USTATREP} then
//numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.URIDATREC}, CurrentDate)
//If {CONTACT2.URODATREC} >= {CONTACT2.USTATREP} then
// numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.URODATREC}, CurrentDate)
//IF (isnull({CONTACT2.USTATREP})) then
// numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.UDATERECD}, CurrentDate);
CONTACT2.UDATERECD=Date ticket was opened
CONTACT2.URIDATREC=Reinspect the ticket for problems
CONTACT2.URODATREC=Reopen the ticket for various reasons (not problem related)
CONTACT2.USTATREP=Status was updated on this date
Status date can be newer than RI or RO date.
RI or RO can be newer than Status date
Nothing newer than when ticket opened for daterecd field
I'm having a problem getting all the days since last action formula I created to calculate all the filtered records. Any suggestions? I've commented out the code that I originally had in. I am new to crystal.
If (not(isnull({CONTACT2.URIDATREC})) or not(isnull({CONTACT2.URODATREC}))) then
If not(isnull({CONTACT2.URODATREC})) then
If {CONTACT2.URODATREC} >= {CONTACT2.UDATERECD} then
If {CONTACT2.URODATREC} >= {CONTACT2.USTATREP} then
numberVar Days_Since_Action2 :=DateDiff ("d", {CONTACT2.URODATREC}, CurrentDate)
Else
numberVar Days_Since_Action2 :=DateDiff ("d", {CONTACT2.USTATREP}, CurrentDate)
Else -98
Else If not(isnull({CONTACT2.URIDATREC})) then
If {CONTACT2.URIDATREC} >= {CONTACT2.UDATERECD} then
If {CONTACT2.URIDATREC} >= {CONTACT2.USTATREP} then
numberVar Days_Since_Action2 :=DateDiff ("d", {CONTACT2.URIDATREC}, CurrentDate)
Else
numberVar Days_Since_Action2 :=DateDiff ("d", {CONTACT2.USTATREP}, CurrentDate)
Else -99;
If {CONTACT2.USTATREP} >= {CONTACT2.UDATERECD} then
numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.USTATREP}, CurrentDate)
Else numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.UDATERECD}, CurrentDate);
//Else
// If not(isnull({CONTACT2.URODATREC})) then
// If {CONTACT2.URODATREC} >= {CONTACT2.UDATERECD} then
//Else If {CONTACT2.USTATREP} >= {CONTACT2.UDATERECD} then
// numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.USTATREP}, CurrentDate)
// Else numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.UDATERECD}, CurrentDate);
//If {CONTACT2.URIDATREC} >= {CONTACT2.USTATREP} then
//numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.URIDATREC}, CurrentDate)
//If {CONTACT2.URODATREC} >= {CONTACT2.USTATREP} then
// numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.URODATREC}, CurrentDate)
//IF (isnull({CONTACT2.USTATREP})) then
// numberVar Days_Since_Action :=DateDiff ("d", {CONTACT2.UDATERECD}, CurrentDate);