Solved

format a date returned from a dlookup

Posted on 2012-03-20
4
368 Views
Last Modified: 2012-03-20
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.
0
Comment
Question by:BauwensER
  • 2
4 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 37742841
Nearly..

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

Accepted Solution

by:
wshark83 earned 500 total points
ID: 37742864
what's the error message? can you provide an example file?

Try:

format(DLookup("dateinv", "tbldefaults"),"mmm/yyyy")
0
 

Author Comment

by:BauwensER
ID: 37743068
This works, my mistake sorry
0
 
LVL 77

Expert Comment

by:peter57r
ID: 37743260
You don't have to change anything now, but it is convention to accept the First correct answer to be posted.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

This article will show you how to use shortcut menus in the Access run-time environment.
Outlook Free & Paid Tools
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now