Why isn't this working?

srburk

Board Regular
Joined
Mar 25, 2002
Messages
154
MED1: DateDiff("n",[MEDIN1],[MEDOUT1])
MED2: DateDiff("n",[MEDIN2],[MEDOUT2])
MED3: DateDiff("n",[MEDIN3],[MEDOUT3])
MED4: DateDiff("n",[MEDIN4],[MEDOUT4])
MED5: DateDiff("n",[MEDIN5],[MEDOUT5])

Each gives me the number of minutes a patient is seen by five separate doctors based on information entered into MEDIN1, MEDOUT1, MEDIN2, MEDOUT2, etc.

I then want to total the MED calculations to arrive at a total duration in minutes.

MEDT: Sum([MED1]+[MED2]+[MED3]+[MED4]+[MED5])

I get the error:
"You tried to execute a query that does not include the specified expression "ID" as part of an aggregate function.

How can I revise MEDT?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi, I tried doing exactly what you did and got the identical error when using a select query. I got rid of the error by changing this line

MEDT: Sum([MED1]+[MED2]+[MED3]+[MED4]+[MED5])

to this :

MEDT: [MED1]+[MED2]+[MED3]+[MED4]+[MED5]

HTH, Andrew. :)
 
Upvote 0
andrew93 said:
Hi, I tried doing exactly what you did and got the identical error when using a select query. I got rid of the error by changing this line

MEDT: Sum([MED1]+[MED2]+[MED3]+[MED4]+[MED5])

to this :

MEDT: [MED1]+[MED2]+[MED3]+[MED4]+[MED5]

HTH, Andrew. :)

YOU are awesome! Thank you! That worked.
Scott
 
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,242
Members
451,756
Latest member
tommyw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top