J jedder18 Just Livin the Dream! Local time Yesterday, 22:03 Joined Mar 28, 2012 Messages 135 Feb 19, 2014 #1 Using Access 2007 Win 7 Total_Time: Format(nz(DateDiff("n",[Start],[End])/60)) This is my expression in a query. I need to only show 2 decimal places in the results field. HELP!
Using Access 2007 Win 7 Total_Time: Format(nz(DateDiff("n",[Start],[End])/60)) This is my expression in a query. I need to only show 2 decimal places in the results field. HELP!
jdraw Super Moderator Staff member Local time Today, 01:03 Joined Jan 23, 2006 Messages 15,565 Feb 19, 2014 #2 What do you think your Total_Time will look like? I don't see what you are doing with Format
J jedder18 Just Livin the Dream! Local time Yesterday, 22:03 Joined Mar 28, 2012 Messages 135 Feb 19, 2014 #3 format the start and end times to number, allowing for blank or null some answers will be 2.33366666
MarkK bit cruncher Local time Yesterday, 22:03 Joined Mar 17, 2004 Messages 8,472 Feb 19, 2014 #4 I think jdraw's point is that the Format() function takes two parameters. You are only passing it one.
I think jdraw's point is that the Format() function takes two parameters. You are only passing it one.
jdraw Super Moderator Staff member Local time Today, 01:03 Joined Jan 23, 2006 Messages 15,565 Feb 19, 2014 #5 Yes Mark that's the question re Format. I think as long as Start and End are Date data type --and these are very poor choices for names -- that something like this (untested) should work. Total_Time: Round((DateDiff("n",[Start],[End])/60),2)
Yes Mark that's the question re Format. I think as long as Start and End are Date data type --and these are very poor choices for names -- that something like this (untested) should work. Total_Time: Round((DateDiff("n",[Start],[End])/60),2)
MarkK bit cruncher Local time Yesterday, 22:03 Joined Mar 17, 2004 Messages 8,472 Feb 19, 2014 #6 Yeah, or if you do use Format() you can do . . . Code: Format(12.34567890, "0.00") . . . but Format(), as far as I know, always returns a string, and if you want to round a number, you usually want a numeric result.
Yeah, or if you do use Format() you can do . . . Code: Format(12.34567890, "0.00") . . . but Format(), as far as I know, always returns a string, and if you want to round a number, you usually want a numeric result.
J jedder18 Just Livin the Dream! Local time Yesterday, 22:03 Joined Mar 28, 2012 Messages 135 Feb 20, 2014 #7 JDraw...I agree, the names are terrible. I'm working on an existing db of anothers' creation and too far in to change the names. I edited this post....I forgot to put the Round function in... this formula works... Excellent. Thanks so much.
JDraw...I agree, the names are terrible. I'm working on an existing db of anothers' creation and too far in to change the names. I edited this post....I forgot to put the Round function in... this formula works... Excellent. Thanks so much.