Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime Formula

Status
Not open for further replies.

stevess

Technical User
Joined
Jun 10, 2002
Messages
7
Location
GB
Hi,

Someone should know the answer to this.

I have a datetime field that I want to create a formula on.
I need to show any date that is current date + 3 months in advance.

The data is stored as 10/07/02 00:00:00

Cheers.

Steve
 
Dateadd("m",3,Date({DateTimeField})) should do the trick. If you do not have the dateadd() function - which made its debut in CR V8 - it is available for download at the crystal decisions website. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Hi !

You can use the function "DateAdd" (came with version 8).

DateAdd( 'm', 3 , currentdate ) will give you a date that is 3 months in advance.

If you have version 6 or 7 of Crystal Reports, there is a dll that you can download to get the function.

Go to
· Search for UFLDateAdd.exe

/Goran
 
Sorry people, I didn't explain properly what I was after.

This may help explain.

Say I have some renewal dates in the system of
25/8/01
14/9/01
25/9/01
28/10/01

My report needs to look at the date, forget about year.
We need to inform our customers when the renewal is due in 3 months time.

So if I run the report to day, I should see
25/8/01
14/9/01
25/9/01

Can this be done?!?!

Cheers.

Steve
 
Steve,

Why would you only see 3 of the 4 records? Please explain. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Hi,

I will only see the first 3 as they would be up for renewal in the next 3 months.

Cheers.

Steve
 
Seriously Steve, I think what dgillz and Goran have already told you is what you really want.

Just display dates where {Renewal Date} <= Dateadd(&quot;m&quot;,3,{CurrentDate})

Naith
 
In yuor record selection formula use this:

{Renewal Date} in CurrentDate to Dateadd(&quot;m&quot;,3,{CurrentDate})

Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top