Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Forecasting Post Reply Post New Topic
Author Message
steve_r18
Newbie
Newbie


Joined: 30 Sep 2011
Location: Canada
Online Status: Offline
Posts: 10
Quote steve_r18 Replybullet Topic: Forecasting
     Posted: 30 Sep 2011 at 9:27am
Hey everyone, this is likely an easy one, but I'm new with Crystal so please be gentle.

I need to take a default date 11/8/1989 12:00:00AM
which is formatted as MM/DD/YYYY + Time

I need to use another date field but only pull records where the MONTH is 4 months from the default date. Can someone please point me in the right direction on this?

Thanks so much for your help.
Steve
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 30 Sep 2011 at 10:37am
Take a look at the DateAdd function - you can use it to add months to a date.
 
-Dell
IP IP Logged
steve_r18
Newbie
Newbie


Joined: 30 Sep 2011
Location: Canada
Online Status: Offline
Posts: 10
Quote steve_r18 Replybullet Posted: 03 Oct 2011 at 3:14am
The problem is that it will increase by 4 months from the date I reference. Which will include the year. I need to include the month number only, but i still need it to turn over after 12 months back to 1. This works but it includes the year. How can I set it to just check the month?

AddMonthsAndReturnEndOfMonth ( GetDataSetDate ( 'monthend' ),4))
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Oct 2011 at 3:49am
Maybe...
Month(dateadd('m',4,defaultdate))=month(table.otherdate)
IP IP Logged
steve_r18
Newbie
Newbie


Joined: 30 Sep 2011
Location: Canada
Online Status: Offline
Posts: 10
Quote steve_r18 Replybullet Posted: 03 Oct 2011 at 4:16am
Dblank!

Well done my friend!!! It works perfectly. Thanks so much for your help and to those who have responded! Greatly appreciated!


Steve
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