PC Review


Reply
Thread Tools Rate Thread

Dlookup minimum value

 
 
Luis
Guest
Posts: n/a
 
      25th Feb 2010
Hello.

I'm trying to use Dlookup to get the minimum date from a table.

I was trying to do the following command:

mDate=Dlookup(min("dateField"),"tblName")

Somehow the code points an error on"Min", saying that "Sub or Function not
defined".

Is it possible what i'm doing? Is there any other way instead of looping
through all the records?

Thanks.
Luis

 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      25th Feb 2010
Try DMin() instead of DLookup()

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Luis" <(E-Mail Removed)> wrote in message
news:27941884-39B0-4EB7-9FD1-(E-Mail Removed)...
> Hello.
>
> I'm trying to use Dlookup to get the minimum date from a table.
>
> I was trying to do the following command:
>
> mDate=Dlookup(min("dateField"),"tblName")
>
> Somehow the code points an error on"Min", saying that "Sub or Function not
> defined".
>
> Is it possible what i'm doing? Is there any other way instead of looping
> through all the records?
>
> Thanks.
> Luis
>

 
Reply With Quote
 
Paolo
Guest
Posts: n/a
 
      25th Feb 2010
Hi Luis,
to achieve your goal use the dmin function so

mDate=Dmin("dateField","tblName")

HTH Paolo

"Luis" wrote:

> Hello.
>
> I'm trying to use Dlookup to get the minimum date from a table.
>
> I was trying to do the following command:
>
> mDate=Dlookup(min("dateField"),"tblName")
>
> Somehow the code points an error on"Min", saying that "Sub or Function not
> defined".
>
> Is it possible what i'm doing? Is there any other way instead of looping
> through all the records?
>
> Thanks.
> Luis
>

 
Reply With Quote
 
Luis
Guest
Posts: n/a
 
      25th Feb 2010
Perfect!
Thank you all.
Luis


"JimBurke via AccessMonster.com" wrote:

> The first value is supposed to be simply a field name - you can't use an
> operation on the field like that. You want to use the DMin function:
>
> mDate=DMin("dateField","tblName")
>
> Luis wrote:
> >Hello.
> >
> >I'm trying to use Dlookup to get the minimum date from a table.
> >
> >I was trying to do the following command:
> >
> >mDate=Dlookup(min("dateField"),"tblName")
> >
> >Somehow the code points an error on"Min", saying that "Sub or Function not
> >defined".
> >
> >Is it possible what i'm doing? Is there any other way instead of looping
> >through all the records?
> >
> >Thanks.
> >Luis

>
> --
> Jim Burke
>
> Message posted via http://www.accessmonster.com
>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
minimum and the corresponding value dinesh kumar Microsoft Excel Worksheet Functions 4 12th Sep 2007 08:59 PM
dlookup using a date defiined by another dlookup =?Utf-8?B?QmVubnlESGlsbA==?= Microsoft Access VBA Modules 1 8th Aug 2007 01:56 AM
Re: Dlookup function - copying the dlookup info into a field.... Douglas J. Steele Microsoft Access Forms 0 6th Dec 2006 02:05 PM
How to lookup the minimum, 2nd minimum and 3rd minimum......... Mark McDonough Microsoft Excel Worksheet Functions 8 15th Jul 2006 09:39 PM
Dlookup problems (was my Dlookup hell) Kavvy Microsoft Access Form Coding 3 18th Nov 2003 12:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:43 PM.