• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

Date formatting question

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
Mwvarner
Asked:
Mwvarner
  • 2
  • 2
  • 2
  • +2
1 Solution
 
lcohanDatabase AnalystCommented:
use a function like FORMAT:


Format (#28/02/2014#, "yyyymmdd") would return '20140228'
0
 
Rey Obrero (Capricorn1)Commented:
use for dynamic result


=format(dateserial(Year(Date),month(date),0),"yyyymmdd")
0
 
Gustav BrockCIOCommented:
It would be:

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

/gustav
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
MwvarnerAuthor Commented:
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
 
Rey Obrero (Capricorn1)Commented:
@Mwvarner.,

you just added a +0 that means NOTHING
0
 
GowthamNatarajanCommented:
SELECT DATEADD("d", -DAY(date()), date() )
0
 
MwvarnerAuthor Commented:
I was referring to the () after the word date and that does mean something.
0
 
Gustav BrockCIOCommented:
Of course it means something. That's why I posted it as the solution.

/gustav
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now