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!

Problems in finding Date -time difference

Status
Not open for further replies.

jessy111

Technical User
Nov 17, 2002
22
IN
Hi,

I am working on one crystal report. I have 3 fields call statetime and time in state. For the field "Time in state" i need to write a formula which should be time difference between two successful columns

records are like this

STATE TIME TIME IN STATE
Payament 10/31/02 6:30
Sales 10/31/02 6:45
Qualification 10/31/02 6:55

Accross payment recored time in state should display 5mnts
(6.45-6.30),
Accross sales recored "time in state" should display 10mnts
(6:55-6.45)

All the fields are in detail section.Can i solve this someway using datediff function.Idf so how to give the formula?

Pls give any sugesstion
Thanks
Jessy
 
I'll assume that there's a typo where the first difference is 15 minutes, not 5.

And I'm not sure what is meant by a successful column, and it appears that you have both a date field, and a time field, neither of which you shared the data types for, so I'll make the assumption that they are string types and you can adjust later as required.

Here's a datediff function that should work:

datediff("n",cdatetime(previous({MyTable.TIME})+" "+previous({MyTable.TIME IN STATE})),cdatetime({MyTable.TIME}+" "+{MyTable.TIME IN STATE}))

-k kai@informeddatadecisions.com
 
Hi synapsevampire ,

Thanks for the reply.I have one more query.I am grouping my report based on Time field in the above mentioned mail and using a drill down .When user clicks on time it will display the drill down with datails regarding particular call in that time.To get the headings in drill down i moved the main report summary details in the group header to group footer and headings for drill down i kept in group header and hide the group header.So its printing the headings in drill down..Now my problem is that in the drill down report its printing the main report summary details also since i kept it in group footer.I need to print the main report summary details only in main report not in drill down.

could u pls give me a suggestion.

Thanks
jessy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top