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

Time difference (odd question)

Status
Not open for further replies.

clarias

Technical User
Jun 19, 2000
2
GB
I am quite a newcomer to building databases,<br>My question is:<br>Can you set a default day to 05:30am on one day to 05:30am on the next day and then calculate the time difference between 05:30 and any other time in that 24Hr period as a decimal.<br>e.g. The difference between 05:30 and 01:30 = 8.0 Hours <br><br>The decimal number is then used to calculate a production output for that 8 hour period which is then saved in a table.<br><br>Any help is much appreciated
 
I'm not entirely sure what you mean, but there is a function that can be used for finding the difference between two date/times.<br><br>Look up &lt;b&gt;DateDiff&lt;/b&gt; in the Help.<br><br>Jonathan <p> Jonathan<br><a href=mailto:j.w.george@virginnet.co.uk>j.w.george@virginnet.co.uk</a><br><a href= > </a><br>Working with: Visual Basic 6, Access 97, Visual Interdev 6, VBScript, Active Server Pages, SQL Server 6.5, Oracle 7
 
Thanks Jonathon,<br><br>I have worked out how to use the datediff function but this leaves me with a value in hours.<br>I need to convert this into a normal number that I can use in a multiplication sum.<br><br>e.g. The difference between 05.30AM and 08.00 = 2.5hrs<br>I need to multiply the standard machine output of 100 units perhour by 2.5 to set a performance.<br><br>I hope this makes my question easier to follow<br><br>Thanks again Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top