Ally
Registered User.
- Local time
- Today, 00:48
- Joined
- Sep 18, 2001
- Messages
- 617
Hi
Not been around for a while but good to be back!! I find myself using Access again which is great, but what appalling coding skills I did have, have kind of disappeared more or less completely apart from the dead simple stuff.
I have a query, where there are a few fields which are looking at the times between 2 dates. So I have done a DateDiff which is fine. Then I have to find the minimum of those fields to put in a query. I originally tried
IIf([field1]<[field2],[field1],[field2] but for some reason it works in some records and not in others.
Having looked through the forum I found this.
So I have copied this into a module:
It is a Public Function
So in my query I now have:
Minimum([field1],[field2])
But ... I get the error message
Undefined function 'minimum' in expression
Can anyone tell me what I'm doing wrong please?!
Added: I tried this in Northwind as per the example and it's fine. Copied exactly the same table, query and code into my db and it doesn't work!?!?
Many thanks
Ally
Not been around for a while but good to be back!! I find myself using Access again which is great, but what appalling coding skills I did have, have kind of disappeared more or less completely apart from the dead simple stuff.
I have a query, where there are a few fields which are looking at the times between 2 dates. So I have done a DateDiff which is fine. Then I have to find the minimum of those fields to put in a query. I originally tried
IIf([field1]<[field2],[field1],[field2] but for some reason it works in some records and not in others.
Having looked through the forum I found this.
Code:
http://support.microsoft.com/default...b;en-us;209857
So I have copied this into a module:
It is a Public Function
So in my query I now have:
Minimum([field1],[field2])
But ... I get the error message
Undefined function 'minimum' in expression
Can anyone tell me what I'm doing wrong please?!
Added: I tried this in Northwind as per the example and it's fine. Copied exactly the same table, query and code into my db and it doesn't work!?!?
Many thanks
Ally
Last edited: