Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
- I have a field with date and time( e.g 04-24-2011 1:24:56 ).
- Now i want to convert only time into minutes.
Is it possible to do this?
I want to do this b'coz. I need last 10 or 20 0r 30 mins in my report.
- Once i can able to convert the time into minutes. It is easy to reduce the minutes based on my selection of number of mins i need.
Ho Boppy,
simply cut the time from the whole value by using right() method. your time having 7 characters including :
let Totalminutes= subfield(right(FieldName,7),':',1) * 60 + subfield(right(FieldName,7),':',2) + subfield(right(FieldName,7),':',3) / 60
now your Totalminutes variable holding the total minutes..
Another approach to get the total amount of minutes would be:
=interval(frac(timestamp#('04-24-2011 11:24:56', 'MM-DD-YYYY h:mm:ss')),'mm')
Thanks for your response johannes sunden. But when i taken the field of particular date it is not working.
e.g:
=interval(frac(timestamp#('03-01-2011 1:24:14', 'MM-DD-YYYY h:mm:ss')),'mm')
replaced like this
=interval(frac(timestamp#(maxCarrdatetime, 'MM-DD-YYYY h:mm:ss')),'mm')
- I'm trying this to display in text box.
What is the problem? How can i overcome this? Plz help me
You can try using
Interval(StartTime - EndTime) and then formatting this as interval on the number Tab, if you use the format mm , you would get the time difference in minutes
try
round(frac(yourfield),1/*(24/60))