time- time

balahawy

Registered User.
Local time
Today, 13:02
Joined
Sep 29, 2013
Messages
41
Hi all,
really i have 2 fields with format "mmm-dd-yyyy hh:nn:ss"
i want to deduct the fields and the result to be "hh:nn:ss"

i tried it but give me 00:00:00
 
i put this =([Dte1]-[Dte])
 
Try
Code:
= Format([Dte1]-[Dte], "Long Time")
 
i tried it
example = Aug-01-2014 1:00:00 PM -Aug-01-2014 1:50:00 PM
give me 12:50:00 AM :(
but it should give me 00:50:00 only
 
What? Of course it is only 00:50:00. The time difference is only 50 minutes. What are you trying to do here? How would it give 12:50:00 AM?
 
Dte format mmm-dd-yyyy hh:nn:ss AM/PM (Aug-01-2014 1:00:00 PM )
Dte1 format mmm-dd-yyyy hh:nn:ss AM/PM (Aug-01-2014 1:50:00 PM)
X = = Format([Dte1]-[Dte], "Long Time")
give me = 12:50:00 AM any suggestion
 
How about this then?
Code:
= Format(([Dte1] - [Dte]) - #00:00:00 AM#, "HH:NN:SS AMPM")
 
Dte format mmm-dd-yyyy hh:nn:ss AM/PM (Aug-01-2014 1:00:00 PM )
Dte1 format mmm-dd-yyyy hh:nn:ss AM/PM (Aug-01-2014 1:50:00 PM)
X = = = Format(([Dte1] - [Dte]) - #00:00:00 AM#, "HH:NN:SS AMPM")
still doesn't work give the same =12:50:00 AM
 
It does for me !
Code:
? Format((#Aug-01-2014 1:50:00 PM#-#Aug-01-2014 1:00:00 PM#) - #00:00:00 AM#, "HH:NN:SS AMPM")
12:50:00 AM
 
sir when i put your equation
= Format(([Dte1] - [Dte]) - #00:00:00 AM#, "HH:NN:SS AMPM") he change it automatically to
= Format(([Dte1] - [Dte]) - #12:00:00 AM#, "HH:NN:SS AMPM")
why that i don't know
 
I seriously have no clue. It should work :confused:

Have you set Format on the control you are trying to calculate this difference.
 
Could you upload a Stripped DB?

How to Upload a Stripped DB.

To create a Sample DB (to be uploaded for other users to examine); please follow the steps..

1. Create a backup of the file, before you proceed..
2. Delete all Forms/Queries/Reports that are not in Question (except the ones that are inter-related)
3. Delete auxiliary tables (that are hanging loose with no relationships).
4. If your table has 100,000 records, delete 99,990 records.
5. Replace the sensitive information like Telephone numbers/email with simple UPDATE queries.
6. Perform a 'Compact & Repair' it would have brought the Size down to measly KBs..
7. (If your Post count is less than 10 ZIP the file and) Upload it..

Finally, please include instructions of which Form/Query/Code we need to look at. The preferred Access version would be A2003-A2007 (.mdb files)
 
=DateDiff("h",[Dte],[Dte1]) & ":" & (((DateDiff("n",[Dte],[Dte1])/60)-DateDiff("h",[Dte],[Dte1]))*60)


finally
 
thanks for yor effort :) now working after my equation
=DateDiff("h",[Dte],[Dte1]) & ":" & (((DateDiff("n",[Dte],[Dte1])/60)-DateDiff("h",[Dte],[Dte1]))*60)
 
That just gave you 0:50? That was already given to you in Post #4

I think we have come to a miscommunication. The simple
Code:
= Format([Dte1]-[Dte], "Long Time")
Would give you this. Anyway. Glad you found another solution.
 
no sir once i put = Format([Dte1]-[Dte], "Long Time") give me 12:50 why i don't know once i put
=DateDiff("h",[Dte],[Dte1]) & ":" & (((DateDiff("n",[Dte],[Dte1])/60)-DateDiff("h",[Dte],[Dte1]))*60)
give me 0:50 :)

thx for your effort
 

Users who are viewing this thread

Back
Top Bottom