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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get mins form dates

Status
Not open for further replies.

nikol

Programmer
Apr 12, 2005
126
US
Hi,
I have start_date & end_date columns. I used
dateDiff ("h", {start_date}, {end_date}) to get the hours.
Its giving 4.00 hrs
3.00 hrs.Truncating the mins. I want mins also.
I'm trying to use "mins/60" to get whole hrs & mins also.
Is there any other way I can do.




 
Try:

//hours:
int(dateDiff ("n", {start_date}, {end_date})/60)

//Remaining minutes:
remainder(dateDiff ("n", {start_date}, {end_date}),60)

-k
 
Its working but do u know any formula which will join ur both formulas.
Eg.
Start_date End_date Hrs mins
06/09/2005 10:10:00 06/09/2005 11:20:00 1:00 10:00

But I want something like this
1:10(hrs:mins)

int(dateDiff ("n", {start_date}, {end_date})/60)
The above formula is "truncating" the mins which I dont want.
 
The point of that formula was to truncate the mins, the other formula returned the remaining minutes, so for your display use:

int(dateDiff ("n", {start_date}, {end_date})/60)&":"&
remainder(dateDiff ("n", {start_date}, {end_date}),60)

-k
 
What if I have a start date & time and end date & time and I want to find out how long (in hours and minutes) it took. The twist is I want to subtract out the weekend (Saturday & Sunday), but only if a weekend exists within the start & end date and time.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top