cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Formula, regarding date.

Former Member
0 Kudos

Hi

I need to write a formula that shows that if the gift date is before 30/04/YYYY then the Date received should show up as the Gift Date, which is in the record and if it is after 30/04/YYYY then it should be 21/12/YYYY

in the Gift Date record the format is

DD/MM/YYYY 12:00AM

How do I take out the time and just keep the date. What kind of code can i write to just take out the time part of the field.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Thank you

Former Member
0 Kudos

thank you for you help, i was able to do date() to take out the date.

former_member230846
Contributor
0 Kudos

Hi Divyesh,

If I understand your question, you should be able to create a formula to do this.

if {yourdate.field} < date(2008/04/30) then "Gift Date"

else

if {yourdate.field} > date(2008/04/30) then totext(date({yourdate.field}))

In regards to displaying just the date. If your database field is the type of 'datetime', you can create a formula:

date({yourdate.field})

I would recommend that you take a look in the Help menu for additional resources relating to formulas. It contains a lot of examples of how use functions.

Regards,

Wallie

Former Member
0 Kudos

If you want to take out the time then try

date(DD/MM/YYYY 12AM)

to get only the time

Time(DD/MM/YYYY 12AM)

Regards,

Raghavendra

Former Member
0 Kudos

Hi Raghvendra,

I have one cross-tab in which fiscal year period is in column section. user have to insert fiscal year period.

Suppose I enter period : 001.2008 to 005.2008 then i must get the values in cross-tab like April 2008, May 2008, June 2008, July 2008 and so on.. while i am getting all in ascending order. Even i can not used specified order because user may input different value.

So i think i have to use grouping by formula.

But i don't know the formula. Can you help me on this?

Regards,

Rishit

Former Member
0 Kudos

use cDate() -- that'll give you just the date part.