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

Convert Seconds to Minutes

Status
Not open for further replies.

Crater

IS-IT--Management
Jul 14, 2000
1
US
Tying to convert seconds to minutes in a Query using SQL. I am using a linked table via ODBC.&nbsp;&nbsp;I have just started learning Access and have not been successful attaching using VB with an ODBC database, still working through that.&nbsp;&nbsp;If there is a way to accomplish converting seconds to minutes through SQL it would make my life easier.&nbsp;&nbsp;I have looked for a &quot;remainder&quot; feature where if I divided by 60 then was able to grab the remainder I could then put them together.&nbsp;&nbsp;I have thought about taking the decimal value of [seconds]/60 and then multiplying that by 60, it is not totally accurate but with some rounding may be functional. I am almost certain there has to be a better way. (I am probably missing the obvious).<br><br>&nbsp;Thanks in advance.
 
I'm not exactly sure of what you want to do.&nbsp;&nbsp;If you want your seconds converted to minutes then you would divide by 60.&nbsp;&nbsp;If you want to split apart your minutes and your seconds then maybe the following would help:<br><br>SELECT (field1 - (field1 mod 60))/60 as minutes,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;field1 mod 60 as seconds<br>FROM table1;<br><br>where field1 is the field that contains your 'seconds' data.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top