Connecting Tech Pros Worldwide Help | Site Map

Convert minutes to hour and minute in MS Access 2000.

  #1  
Old November 13th, 2005, 02:51 AM
James P.
Guest
 
Posts: n/a
Hello,

In my Access report, I have a minutes field in the detail line. How
do I convert that minute to hour and minute. The problem for me now
is if I take the minutes, say 75 divide by 60, it gives me 1.25; or
90/60 = 1.50. These are not what the user wants.

They want to have hour and minutes, say 75 minutes, needs to convert
to 1.15 (1 hour 15 minutes); or 90 minutes to 1.30, and so on.

Are there any easy way to do it? Thanks in advance,

James
  #2  
Old November 13th, 2005, 02:51 AM
Allen Browne
Guest
 
Posts: n/a

re: Convert minutes to hour and minute in MS Access 2000.


Use Integer division to get the whole hours, and Mod to get the left over
minutes:
=[Minutes] \ 60 & Format([Minutes] Mod 60, "\:00")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"James P." <hanoi_honai@yahoo.com> wrote in message
news:f49d1d72.0408172133.3f61f470@posting.google.c om...[color=blue]
> Hello,
>
> In my Access report, I have a minutes field in the detail line. How
> do I convert that minute to hour and minute. The problem for me now
> is if I take the minutes, say 75 divide by 60, it gives me 1.25; or
> 90/60 = 1.50. These are not what the user wants.
>
> They want to have hour and minutes, say 75 minutes, needs to convert
> to 1.15 (1 hour 15 minutes); or 90 minutes to 1.30, and so on.
>
> Are there any easy way to do it? Thanks in advance,
>
> James[/color]


  #3  
Old November 13th, 2005, 02:52 AM
James P.
Guest
 
Posts: n/a

re: Convert minutes to hour and minute in MS Access 2000.


"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message news:<4122eb22$0$17534$5a62ac22@per-qv1-newsreader-01.iinet.net.au>...[color=blue]
> Use Integer division to get the whole hours, and Mod to get the left over
> minutes:
> =[Minutes] \ 60 & Format([Minutes] Mod 60, "\:00")
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "James P." <hanoi_honai@yahoo.com> wrote in message
> news:f49d1d72.0408172133.3f61f470@posting.google.c om...[color=green]
> > Hello,
> >
> > In my Access report, I have a minutes field in the detail line. How
> > do I convert that minute to hour and minute. The problem for me now
> > is if I take the minutes, say 75 divide by 60, it gives me 1.25; or
> > 90/60 = 1.50. These are not what the user wants.
> >
> > They want to have hour and minutes, say 75 minutes, needs to convert
> > to 1.15 (1 hour 15 minutes); or 90 minutes to 1.30, and so on.
> >
> > Are there any easy way to do it? Thanks in advance,
> >
> > James[/color][/color]

Thank you very much, Allen. It works like a champ!

James
Closed Thread