Jump to content

Recommended Posts

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.