Dlookup and Dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following field in a query.

DLookUp("gl_perod_id","ingres_gl_perod_tbl","[gl_perod_stdt]<=" &
Format([BegDate],"\#mm\/dd\/yyyy\#") & " and [gl_perod_enddt]>=" &
Format([BegDate],"\#mm\/dd\/yyyy\#"))

It keeps on giving me #Error. Any ideas or suggestions? I am using Access
2003.
 
I solved the problem.

The function should be....

DLookUp("gl_perod_id","ingres_gl_perod_tbl","cdate([gl_perod_stdt])<= " &
Format([BegDate],"\#mm\/dd\/yyyy\#") & " and cdate([gl_perod_enddt])>= " &
Format([BegDate],"\#mm\/dd\/yyyy\#"))
 
Even better (more portable) is using military Format
ie
yyyy-mm-dd

HtH

Pieter

SHIPP said:
I solved the problem.

The function should be....

DLookUp("gl_perod_id","ingres_gl_perod_tbl","cdate([gl_perod_stdt])<= " &
Format([BegDate],"\#mm\/dd\/yyyy\#") & " and cdate([gl_perod_enddt])>= " &
Format([BegDate],"\#mm\/dd\/yyyy\#"))
--
M. Shipp


SHIPP said:
I have the following field in a query.

DLookUp("gl_perod_id","ingres_gl_perod_tbl","[gl_perod_stdt]<=" &
Format([BegDate],"\#mm\/dd\/yyyy\#") & " and [gl_perod_enddt]>=" &
Format([BegDate],"\#mm\/dd\/yyyy\#"))

It keeps on giving me #Error. Any ideas or suggestions? I am using Access
2003.
 
Back
Top