Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: CODE FOR CONVERTING DATE TO MINUTES Post Reply Post New Topic
Author Message
shanila_minnu
Newbie
Newbie


Joined: 21 Jul 2010
Location: India
Online Status: Offline
Posts: 1
Quote shanila_minnu Replybullet Topic: CODE FOR CONVERTING DATE TO MINUTES
    Posted: 21 Jul 2010 at 11:56pm

Below code is giving the output as :

Eg:5 days 1hr 23 minutes


DateTimeVar AssgnDateTime := DateTime ({@Assgn_date},{@Assgn_Time});
DateTimeVar ResDateTime := DateTime ({@Res_date},{@Res_Time});                        

StringVar TimeSinceBreach := DateTimeDiff(AssgnDateTime,ResDateTime);                 

NumberVar MinPos := InStr (1,TimeSinceBreach ,"Minute(s)" );


How can i convert 5 days 1hr 23 minutes in to minutes alone that is 5*24*60+1*60+23 minutes.

Please help me



Edited by shanila_minnu - 21 Jul 2010 at 11:57pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 26 Jul 2010 at 3:28am
datediff("n", dateToConvert, 0) and if that gives a negative, reverse the 0 and the date.  Or however you get the difference, just use the "n" parameter, it will give the answer in minutes.
 
HTH
IP IP Logged
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.