Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports
Viewing all articles
Browse latest Browse all 4814

Trouble with DateDiff

$
0
0

I feel like this should be extremely easy and that I'm overthinking it, but I just can't get it to work.

 

One table that shows fruit in storage. When an order is placed in storage, {TABLE.STATUS} =  "Hold", and when it is removed from storage, {TABLE.STATUS} = "Unhold". There is one date/time field called {TABLE.DATETIME}. My goal is to filter by TABLE.ORDER, show {TABLE.DATETIME} for "Hold", show {TABLE.DATETIME} for "Unhold", and a formula that calculates the difference between them in minutes.

 

When I filter on order number and {TABLE.STATUS} Like "*hold*", I can see the 2 date/times that I want, one above the other in Details. It should be so easy to just put them in DateDiff, but every combination I try gets me zero.

 

I created @HoldDate which is:

If {TABLE.STATUS} = "Hold" Then {TABLE.DATETIME}

 

I created @UnholdDate which is:

If {TABLE.STATUS} = "Unhold" Then {TABLE.DATETIME}

 

I created @HoldDifference which is:

DateDiff('n',@HoldDate,@UnholdDate)

 

No matter where I place @HoldDifference I always get zero. I tried grouping by the fields and formulas, and still @HoldDifference is not working.

 

What am I missing?


Viewing all articles
Browse latest Browse all 4814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>