Solved

Date formatting question

Posted on 2014-03-28
8
308 Views
Last Modified: 2014-03-28
I have a date formatting question.   I need show the last day of the previous month on a report I am working on in Access 2013.  The format should be 20140228.
0
Comment
Question by:Mwvarner
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 39962264
use a function like FORMAT:


Format (#28/02/2014#, "yyyymmdd") would return '20140228'
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 39962269
use for dynamic result


=format(dateserial(Year(Date),month(date),0),"yyyymmdd")
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39962385
It would be:

=Format(DateSerial(Year(Date()),Month(Date()),0),"yyyymmdd")

/gustav
0
 

Author Closing Comment

by:Mwvarner
ID: 39962400
That is what I needed but it needed a little tweaking.  She the corrected syntax below.

Format(DateSerial(Year(Date()),Month(Date())+0,0),"yyyymmdd")
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39962470
@Mwvarner.,

you just added a +0 that means NOTHING
0
 
LVL 2

Expert Comment

by:GowthamNatarajan
ID: 39962529
SELECT DATEADD("d", -DAY(date()), date() )
0
 

Author Comment

by:Mwvarner
ID: 39962536
I was referring to the () after the word date and that does mean something.
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39962913
Of course it means something. That's why I posted it as the solution.

/gustav
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

758 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

19 Experts available now in Live!

Get 1:1 Help Now