Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Date Modification Formula Post Reply Post New Topic
Author Message
kaupang
Newbie
Newbie
Avatar

Joined: 14 Jul 2010
Location: United States
Online Status: Offline
Posts: 11
Quote kaupang Replybullet Topic: Date Modification Formula
    Posted: 14 Jul 2010 at 5:09am
Hello,

I am trying to display a specific date time in my report based upon a start date parameter entered.  For example, if the user enters a start/open date of 7/1/10 hh:mm:ss, then in the report I want it to display 6/30/10 11:59:59 PM, the previous date at 11:59:59.

Is there a simple formula that will do this?

Thanks in advance and let me know if I've posted in the place.
Kaupang
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Jul 2010 at 5:30am
date(dateadd('d',-1,{?dateparam})) + time(11,59,59)
IP IP Logged
kaupang
Newbie
Newbie
Avatar

Joined: 14 Jul 2010
Location: United States
Online Status: Offline
Posts: 11
Quote kaupang Replybullet Posted: 14 Jul 2010 at 5:34am
Ohh man, that is so slick!

Thank you so much!!!

Big%20smile
Kaupang
IP IP Logged
kaupang
Newbie
Newbie
Avatar

Joined: 14 Jul 2010
Location: United States
Online Status: Offline
Posts: 11
Quote kaupang Replybullet Posted: 14 Jul 2010 at 7:48am
date(dateadd('d',-1,{?dateparam})) + time(23,59,59)
Kaupang
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Jul 2010 at 8:16am
oops. sorry about that.
it does use the hours that way.
nice catch
IP IP Logged
kaupang
Newbie
Newbie
Avatar

Joined: 14 Jul 2010
Location: United States
Online Status: Offline
Posts: 11
Quote kaupang Replybullet Posted: 14 Jul 2010 at 8:21am
No worries at all.  I'm a totally n00b with this stuff and greatly appreciate your response!!! Big%20smileBig%20smileBig%20smile
Kaupang
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

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



This page was generated in 0.016 seconds.