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!

Zeroing out a datetime field 1

Status
Not open for further replies.

kandikcj

IS-IT--Management
Dec 20, 2002
12
US
I am having a problem with CR8.5. What I want to do is find the difference between two datetime records. I can get the difference but what I need to do now is zero out the variables when I switch to a new record. I can't find a way to set a datetime variable to zero (or null)
 
Why do you need variables to do this? What are the 2 datetime records? More detail please Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
When an order is created it has a status of new in the order status history table. When it is acknowledged it creates another record in the order status history table. I am trying to get the amount that elapses form when an order is new to when it is acknowledged. I am comparing the times that the two rows are created to find the difference. Since they are in two different rows I am using variables to save the values but when I go on to a new order the variables have the times from the previous order. This gets to be a bit of a problem when we have orders that were never acknowledged thus causing bad data to get passed on to the next records.
 
Group by order, and put a formula in the group header to reset the variable values back to zero. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
That is where the problem lies. When I try and set the variable to zero I get an error saying a Datetime is required here. What needs to be done to set a datetime to zero?
 
Try this:

WhilePrintingRecords;
DateTimeVar MyVariableName:=Datetime(0,0,0,0,0,0) Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top