Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: dateadd
Author
Message
cfrey
Groupie
Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Topic: dateadd
Posted: 06 May 2008 at 8:10am
I'm trying to calculate the last day of the previous month from a parameter. Here is my code:
dateadd("M", -1,{?ReportDate})
If the report date was April 30, 2008 the above returns March 30, 2008. I need to return March 31, 2008.
Your help is appreciated.
Thanks.
IP Logged
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 06 May 2008 at 9:56am
Try something like this:
date(year({?ReportDate}), month({?ReportDate}), 1) -1
-Dell
Proviti, Data & Analytics Practice
www.protiviti.com/US-en/data-management-advanced-analytics
IP Logged
cfrey
Groupie
Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Posted: 06 May 2008 at 1:20pm
That worked. I can't thank you enough.
I thought dateadd took the change in month ends into account. I guess I was very wrong.
Thanks again for your help.
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
delete your posts in this forum
You
cannot
edit your posts in this forum
You
cannot
create polls in this forum
You
cannot
vote in polls in this forum
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
KONACAD
© 2004-2026 Brian Bischof. All Rights Reserved.