Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

format a date returned from a dlookup

Posted on 2012-03-20
4
Medium Priority
?
384 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

972 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