Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Covert a DATE/TIME to string value in VBA

Posted on 2005-03-08
3
Medium Priority
?
705 Views
Last Modified: 2008-02-01
For the Life of me I cant find a function to convert a DATE/TIME field to a String

Im sure I can you a datepart function but that would be ugly.

But does VBA have a Function to change a standard access date/time to a String?
I know they have the opposite datevalue(September 15, 2005) to 9/15/05

Thanks for the Help!

Joe V
0
Comment
Question by:joein610
  • 2
3 Comments
 
LVL 11

Expert Comment

by:Stephen_Perrett
ID: 13485361
format(Now,"dd/mm/yy")
steve
0
 
LVL 9

Accepted Solution

by:
Bat17 earned 1000 total points
ID: 13485370
Use the format function
format(#1/15/05#,"DD/MM/YYYY") or
format(Date(),"DD/MM/YYYY")

HTH

Peter
0
 
LVL 11

Expert Comment

by:Stephen_Perrett
ID: 13485382
You can create any format you want  e.g. "mmmm d, yyyy"
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Beware when using the ListIndex and the Column() properties of a listbox in Access 2007.  A bug has been identified in the Access 2007 listbox code which can cause the .ListIndex property to return a -1, and the .Columns(#) property to return a NULL…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

564 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