shocker-z Posted June 1, 2007 Share Posted June 1, 2007 Hi, Is there a way that i could calculate the amount of hours between 2 fields either within a ms access odbc query in php or even in the query? I've tryed using this $curID=15414; $getcalls="SELECT Maintenance_ID, [Allocated To], left([Date Closed],10) as `closed`, ([Date Closed] - [Date Logged]) as sla FROM Maintenance_Dbf WHERE Maintenance_ID = $curID"; but this returns -0.441180555557366 I think the problem that you i need to bear in mind is that Date Logged is a shortdate and Date Closed is a Medium date example of the date which are used in query above are as follows. Date Logged - Short Date - 01/06/2007 10:35:18 DATE Closed - Medium Date - 2007-06-01 00:00:00 i do have a time closed which could be appended when time show's 00:00:00 and then possibly put into a temperary mysql database to be calculated in? I know this is going to be a work around rather than a fix but unfortunatly my director made the database and has modified it in access for 4 years so is hard to make changes to make it better as theres always somthing else that goes wrong and access is what he knows and the database is his litle baby. Would be LOADS better as MSSQL or even MySQL only 10 users use it. Regards Liam Quote Link to comment https://forums.phpfreaks.com/topic/53868-deduct-ms-access-querys-hort-date-from-medium-date/ Share on other sites More sharing options...
shocker-z Posted June 2, 2007 Author Share Posted June 2, 2007 Anyone? Another way of explaining it is how do people do it on forums where it says "posted 5hours 24minutes ago"? as i can construct the correct date/time stamp but need to know how to deduct 1 off the other? Regards Liam Quote Link to comment https://forums.phpfreaks.com/topic/53868-deduct-ms-access-querys-hort-date-from-medium-date/#findComment-266768 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.