Solved

Date formatting question

Posted on 2014-03-28
8
313 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

756 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