Functions with Dlookup?



Can you use a function within Dlookup? If so, how....

I am trying to extract information from a table, but I want to do it for a
particular month. So I was trying to do the following, but wasn't having
much luck trying to retrieve the month number from a date field. Any help
would be appreciated:

In this example, Date is a Field in the database with the datatype of
Date/Time

sTest = DLookup("[MilesRecordedID]", "VanMiles", "Month([Date]) = " &
iMonth & " AND [VanID] = " & rsVans!VanID)
.



Relevant Pages

  • Re: What does "#Name?" mean in a form field?
    ... > on the form that I want to compare to the field in the table. ... Each argument in the DLookUp must be a string expression (enclosed ... What is the datatype of the Item field in the table? ... name of any field used within it's control source expression. ...
    (microsoft.public.access.gettingstarted)
  • Re: Please Help! Ref Article ID 210504
    ... > for the DLookUp to find the "Out Time" of the previous event based on the ... some sample data to provide a clearer explanation. ...
    (microsoft.public.access.gettingstarted)
  • Re: Expression Builder Help
    ... I tried the DLookup, but I am new at this and learning on the fly. ... not the recordsource for the form. ... The above assumes that is a Number datatype. ... Where clause + Restrict data to a subset of records ...
    (microsoft.public.access.forms)
  • Re: Syntax error on Dlookup Function
    ... Thanks so much for that, Fred, the error has stopped but the Dlookup doesn't ... Since [InspLocID] appears to be a Number datatype, ... the RepairerName - can I build a Dlookup on ...
    (microsoft.public.access.forms)
  • Re: Expression Builder Help
    ... I tried the DLookup, but I am new at this and learning on the fly. ... not the recordsource for the form. ... The above assumes that is a Number datatype. ... Where clause + Restrict data to a subset of records ...
    (microsoft.public.access.forms)

Loading