Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: CurrentMonth Post Reply Post New Topic
Author Message
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Topic: CurrentMonth
     Posted: 30 Oct 2013 at 9:43am
am completely on brain lock and am trying to add to a current report using the formula below.  We use 01/01/1800 to pull previous month on most our reports. Today we wanted to 'add' using 01/01/1950 to this formula, to pull Current Month To Date and I am just stumped on something I know is easy.  Looking for a little help and apologize for the simplicity of the question.

BEG DATE:

dateVar EndMonth := Date(Year(DataDate),Month(DataDate),01)-1;

If {?Beg Date} = Date(1800,01,01) Then

Date(Year(EndMonth),Month(EndMonth),01)

If {?Beg Date} = Date(19501,01) Then

..........

END DATE:

If {?End Date} = Date(1800,01,01) Then

Date(Year(DataDate),Month(DataDate),01)-1

Else

If {?End Date} = Date(19501,01) Then

............

BRAIN Dead SORRY!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Oct 2013 at 9:49am

do you use the results in your select statement for the data pull?

you can simplify this as
 
(?beg date = date(1800,1,1) and table.datefield in lastfullmonth)
or
(?beg date = date(1950,1,1) and table.datefield in monthtodate)
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 30 Oct 2013 at 9:53am

Yes, we use the results for the data pull..but your idea works on many other reports THANK YOU!  This didn't work on the specific report I am using right now.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Oct 2013 at 10:03am
what is your current select statement?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Oct 2013 at 10:15am

BEG DATE:

dateVar EndMonth := Date(Year(DataDate),Month(DataDate),01)-1;

If {?Beg Date} = Date(1800,01,01) Then

Date(Year(EndMonth),Month(EndMonth),01)

If {?Beg Date} = Date(19501,01) Then

Date(Year(DataDate),Month(DataDate),01)

END DATE:

If {?End Date} = Date(1800,01,01) Then

Date(Year(DataDate),Month(DataDate),01)-1

Else

If {?End Date} = Date(19501,01) Then currentdate



Edited by DBlank - 30 Oct 2013 at 10:15am
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 30 Oct 2013 at 10:20am
AWESOME!! I cannot thank you enough it worked!  I was just on a complete brain lock (dead) morning! Thank you for your time....Big%20smile
IP IP Logged
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