Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: DOB is a memo field Post Reply Post New Topic
Author Message
MicheleM
Newbie
Newbie
Avatar

Joined: 05 Apr 2011
Location: United States
Online Status: Offline
Posts: 26
Quote MicheleM Replybullet Topic: DOB is a memo field
     Posted: 26 Oct 2012 at 2:57am
Can it be converted to an actual "date"? Currently it comes over like Feb 4, 2012, I tried changing it to a string and then doing the following:

StringVar Months := Left ({@DOB},3);
StringVar Days := Mid ({@DOB},2 ,2 );
StringVar Years := Mid({@DOB},4)

the days and years work just fine... but I am clueless on how to get the Month to change over.

What I'm really looking for is to find out how old our clients are.

Please help!
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 26 Oct 2012 at 4:01am
if you just wanna do the month; you can do two things first.

( CASE [fldmonth]
           WHEN 'January' THEN 1
           WHEN 'February' THEN 2
           WHEN 'March' THEN 3
           WHEN 'April' THEN 4
           WHEN 'May' THEN 5
           WHEN 'June' THEN 6
           WHEN 'July' THEN 7
           WHEN 'August' THEN 8
           WHEN 'September' THEN 9
           WHEN 'October' THEN 10
           WHEN 'November' THEN 11
           WHEN 'December' THEN 12
        END )


otherwise, CAST('{Date}' AS DATETIME) and you can work with datediff
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