format a date returned from a dlookup

Is there a way to format a date that was returned from a dlookup?

For example: I tried this:

myformatteddate = Format(Dlookup("[dateinv]", "tbldefaults","mmmm, yyyy"))

but that produces an error.

Thanks.
BauwensERAsked:
Who is Participating?
 
wshark83Commented:
what's the error message? can you provide an example file?

Try:

format(DLookup("dateinv", "tbldefaults"),"mmm/yyyy")
0
 
peter57rCommented:
Nearly..

myformatteddate = Format(Dlookup("[dateinv]", "tbldefaults"),"mmmm, yyyy")
0
 
BauwensERAuthor Commented:
This works, my mistake sorry
0
 
peter57rCommented:
You don't have to change anything now, but it is convention to accept the First correct answer to be posted.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.