[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Change Date format in Report control

Posted on 2007-08-10
6
Medium Priority
?
535 Views
Last Modified: 2013-11-28
I need to change date entries like 2007-1, 2007-2, 2007-3 to entries that would show Jan-31-07, Feb-28-07, Mar-31-07. I need it to basically show the last day of the month depending on the first entry (ie 2007-1 for Jan 2007). It should show Jan-31-07. Thanks in advance.
0
Comment
Question by:vacnet
6 Comments
 
LVL 75
ID: 19673811
Format(DateAdd("m",1,#2007-1#)-1,"mmm-dd-yy")

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1600 total points
ID: 19673815
Example:

Format(DateAdd("m",1,#2007-1#)-1,"mmm-dd-yy")

returns 01-31-2007

mx
0
 
LVL 75
ID: 19673821
Sorry ... that returns

Jan-31-07

mx
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 77

Expert Comment

by:peter57r
ID: 19673831
What data type are 2007-1, 2007-2, 2007-3 held in?
Are they already formatted date fields or are they text?
0
 
LVL 3

Assisted Solution

by:kaosyeti
kaosyeti earned 400 total points
ID: 19673857
if you need to change it in the same text box that the user inputs the 2007-1, put this in the box's afterupdate event (make sure that the text box is formatted for yyyy-m in the format property):

me.<YourTextBox> = Format(DateAdd("m",1,me.YourTextBox)-1,"mmm-dd-yy")<--mx's code exactly

if you wanted it in a different text box, then mx's answer is all you need.
0
 
LVL 1

Author Comment

by:vacnet
ID: 19684472
Thanks to all!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

829 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