Solved

Date formatting question

Posted on 2014-03-28
8
317 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
[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
  • 2
  • 2
  • +2
8 Comments
 
LVL 40

Expert Comment

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


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

Accepted Solution

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


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

Expert Comment

by:Gustav Brock
ID: 39962385
It would be:

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

/gustav
0
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 

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
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 50

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

Independent Software Vendors: 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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

688 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