Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date Format Conversions Post Reply Post New Topic
Author Message
srklg1
Newbie
Newbie
Avatar

Joined: 10 Sep 2007
Location: United States
Online Status: Offline
Posts: 22
Quote srklg1 Replybullet Topic: Date Format Conversions
    Posted: 10 Oct 2007 at 7:24am
Good morning, all!
 
I have a field in the SELECT statement that is a standard YYYY-MM-DD 00:00:00 format and I would like to convert that value to a simple YYYY format.  Then I would like to group by that value in the report.
 
What is the syntax for the conversion?
 
I have tried the following:
 
TO-DATE / TODATE
TOTEXT
 
Searching the web, i'm not finding what I need.
 
Thanks,
 
SRK
srklg1
IP IP Logged
wattsjr
Groupie
Groupie
Avatar

Joined: 25 Jun 2007
Location: United States
Online Status: Offline
Posts: 51
Quote wattsjr Replybullet Posted: 10 Oct 2007 at 8:14am
Hi srklg1,
 
Try Year(x).  It will return the year portion of your date as a numeric value.
 
1. Create a formula called Year (or something more meaingful to you).
2. In the formula create the line "Year(your-date-field-name)" - without the quotes.
3. Insert your new group, using your new formula for the group.
 
Regards,


Edited by wattsjr - 10 Oct 2007 at 8:38am
-jrw
IP IP Logged
srklg1
Newbie
Newbie
Avatar

Joined: 10 Sep 2007
Location: United States
Online Status: Offline
Posts: 22
Quote srklg1 Replybullet Posted: 10 Oct 2007 at 2:16pm
That worked!
 
Thanks for the direction.
 
SRK
srklg1
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.031 seconds.