My table has two date fields both having a date and time (ex: 12/05/2005 12:05:00 PM). My goal is finding the difference between 2 times. In a query, I converted this time difference from a date/time format to look like this: __ days __hrs __min.
I was wondering how I could also show only those times(records) that are greater than 24 hours with this query or using another query along with my current one. (anything being greater than 24 hrs is shown and anything under is not displayed.
Here is my current query:
SELECT Documents.[Record Number], Documents.[Date of Appointment], Int(DateDiff("n",Documents![Date of Appointment],Documents![HX Documents])/1440) & "day " & Format(DateDiff("n",Documents![Date of Appointment],Documents![HX Documents])/1440,"h""hr ""n") & "min" AS [HX Late], Int(DateDiff("n",Documents![Date of Appointment],Documents![Prospective Documents])/1440) & "day " & Format(DateDiff("n",Documents![Date of Appointment],Documents![Prospective Documents])/1440,"h""hr ""n") & "min" AS [Prospective Late], Int(DateDiff("n",Documents![Date of Appointment],Documents![External Documents])/1440) & "day " & Format(DateDiff("n",Documents![Date of Appointment],Documents![External Documents])/1440,"h""hr ""n") & "min" AS [External Late]
FROM Documents
WHERE (((Documents.[Date of Appointment]) Between [Enter Start Date (ex: mm/dd/yyyy)] And [Enter End Date (ex: mm/dd/yyyy)]));
Any advice is greatly appreciated.. I know this query is ugly.
I was wondering how I could also show only those times(records) that are greater than 24 hours with this query or using another query along with my current one. (anything being greater than 24 hrs is shown and anything under is not displayed.
Here is my current query:
SELECT Documents.[Record Number], Documents.[Date of Appointment], Int(DateDiff("n",Documents![Date of Appointment],Documents![HX Documents])/1440) & "day " & Format(DateDiff("n",Documents![Date of Appointment],Documents![HX Documents])/1440,"h""hr ""n") & "min" AS [HX Late], Int(DateDiff("n",Documents![Date of Appointment],Documents![Prospective Documents])/1440) & "day " & Format(DateDiff("n",Documents![Date of Appointment],Documents![Prospective Documents])/1440,"h""hr ""n") & "min" AS [Prospective Late], Int(DateDiff("n",Documents![Date of Appointment],Documents![External Documents])/1440) & "day " & Format(DateDiff("n",Documents![Date of Appointment],Documents![External Documents])/1440,"h""hr ""n") & "min" AS [External Late]
FROM Documents
WHERE (((Documents.[Date of Appointment]) Between [Enter Start Date (ex: mm/dd/yyyy)] And [Enter End Date (ex: mm/dd/yyyy)]));
Any advice is greatly appreciated.. I know this query is ugly.