Solved

Date formatting question

Posted on 2014-03-28
8
312 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 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 49

Expert Comment

by:Gustav Brock
ID: 39962385
It would be:

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

/gustav
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

840 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