Dlookup and Dates

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.
 
G

Guest

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\#"))
 
P

Pieter Wijnen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top