Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

format a date returned from a dlookup

Posted on 2012-03-20
4
Medium Priority
?
382 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

705 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