Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: HELP I need a formula for a time duration Post Reply Post New Topic
<< Prev Page  of 3 Next >>
Author Message
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 15 Aug 2008 at 8:20am
Hi
 
 
try this
 
 
if     isnumeric({vrAttendance.FinishTime})
and isnumeric({vrAttendance.SeenTime}) then
tonumber({vrAttendance.FinishTime})- tonumber({vrAttendance.SeenTime})
else
0.00
 
I think some values in finishtime or seentime are nulls or spaces.
 
let me know if the above code works if not please do the following 
 
Ok can you post me some more sample records,does all records have
values in them,what database are you using.
 
Cheers
Rahul
IP IP Logged
fairy princess
Newbie
Newbie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
Quote fairy princess Replybullet Posted: 15 Aug 2008 at 8:26am
hi u try gent
all i gettin is a 0.00 value
xx
Many Thanks the tooth fairy
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 15 Aug 2008 at 8:29am
Ok
 
Some more sample data please...........
 
cheers
Rahul
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 18 Aug 2008 at 7:34am
Hi,
Did u manage to resolve the issue?
cheers
Rahul
IP IP Logged
fairy princess
Newbie
Newbie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
Quote fairy princess Replybullet Posted: 19 Aug 2008 at 12:49am

Hi

Have not sorted out the prob when i run it it just gives me 0.00 in return
 
 
{vrAttendance.AttendanceType} in ["Follow-up (Old)", "New Patient", "Rebook Patient"] and
{vrAttendance.SeenTime} in "09.00" to "16.00" and
{vrEpisode.Location} = "QEQM -THANET" and
{vrAttendance.AttendanceDate} in DateTime (2008, 06, 01, 00, 00, 00) to DateTime (2008, 06, 07, 00, 00, 00)
 
seentime & finishtime is  string
Many Thanks For your Help
Many Thanks the tooth fairy
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 19 Aug 2008 at 1:10am
Hi,
 
Are you getting records for the selection below .also you are checking for Seetime in "09.00" to "16.00" do you also need to check Finish Time?
 
Can you post the output sample records that you are getting for selection below.
 
Cheers
Rahul
IP IP Logged
fairy princess
Newbie
Newbie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
Quote fairy princess Replybullet Posted: 19 Aug 2008 at 3:58am
HI
 
Attendance Date          SeenTime      FinishTime             Time Difference
 
     jun-08                        09.00               09.25                    0.00
 
this is the outcome
Many Thanks the tooth fairy
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 19 Aug 2008 at 4:50am
That seems strange ,what database are you using
 
Access
Sql Server
Oracle.
 
Cheers
Rahul
IP IP Logged
fairy princess
Newbie
Newbie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 21
Quote fairy princess Replybullet Posted: 19 Aug 2008 at 4:56am
Sql Server
ODBC (RDO)
Many Thanks the tooth fairy
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 19 Aug 2008 at 5:07am
That is very strange
 
I have created a test table in Sql Server 2000 and this is the data
using ODBC(RDO) i am getting the results below the formula is same as posted before
 
 
SeenTime  FinishTime  frm_time
09.00        16.00          7.00
12.00        13.00         1.00
08.45         09.12        0.67
                  0.19          0.00
09.00         09.25        0.25
 
Confused 
 
what if you remove all the filters do you still get 0.00 do one thing comment out the entire record selection formula and let me know
 
can you paste few more records.
 
Thanks
Rahul
IP IP Logged
<< Prev Page  of 3 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.