Search code examples
ms-accessms-access-2010datediff

Remove Enter Parameter Value


I'm trying to calculate the time difference between two variables. The first variable is checkin_time and the second variable is triage_time. Both variables contain values with the same format, for example... 12/31/2018 3:24:00 PM.

So in theory I would be subtracting Checkin_time (12/31/2018 3:24:00 PM) from Triage_time (12/31/2018 4:24:00 PM) to get 60 minutes.

I'm using the following code to calculate the time difference

Select DateDiff(Minute,CHECKIN_TIME,triage_time) AS triagetime
From TAT_Import

but when executing this query I'm getting an 'enter paramteer value' pop up box and it's asking me to enter a value for minutes.

How do I run my query without having to enter a value for minutes in the pop up box?

Thanks!


Solution

  • The DateDiff function requires a string as the first argument, hence your code should be:

    select DateDiff("n", CHECKIN_TIME, triage_time) AS triagetime
    from TAT_Import