Print Page | Close Window

Convert date format and append it with Time

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5631
Printed Date: 05 May 2024 at 10:19pm


Topic: Convert date format and append it with Time
Posted By: achaithanya
Subject: Convert date format and append it with Time
Date Posted: 27 Feb 2009 at 6:35am
Hi,
 
I have a requirement of this type. we have In date,In time,Out date,out time. we need to capture all these details and compare them and need to display the time diff.
 
eg:  In Date    5/15/2008 12:00:00 AM
       Out date  5/15/2008 12:00:00 AM
       In Time    5/15/2008 8:00:00 AM
       Out Time  5/15/2008 5:00:00 PM
My formulae should work such that
I need to get Date from In Date and append it with In Time
eg: In DateTime   2008/15/05 08:00
      Out DateTime 2008/15/05 17:00
Here i need to compare these to fields and get the output.
I need to get Time in in the In DateTime,Out DateTime and compare and display the Total time.
 
Can any one of you help me out in solving this.
 
Thank you,
Akki



Replies:
Posted By: lockwelle
Date Posted: 27 Feb 2009 at 6:52am
I'm confused as in your example the in Time has a date associated with it, but if you need to concatenate the 2 fields it is not hard.
 
something like:
datetimevar Start := cdate({inDate}) + ctime({inTime});
 
should work, same for the end time and then you can use a function to determine the difference.
 
Hope this helps.


Posted By: achaithanya
Date Posted: 01 Mar 2009 at 8:10pm
I will try out this option and let you know.
 
Thanks for your reply.


Posted By: achaithanya
Date Posted: 01 Mar 2009 at 11:17pm
Thank you.I got the solution. instead of converting date and time seperately i have the formulae suggested by and i have used Datediff function.

-------------
Chaitu



Print Page | Close Window