Print Page | Close Window

Date problem

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15977
Printed Date: 04 May 2024 at 9:08am


Topic: Date problem
Posted By: Rhonda
Subject: Date problem
Date Posted: 25 Mar 2012 at 9:41am
I am working with a new software system where the date was formatted as a number.  For March 24, 2012, I get 1120324.  There is always a prefaced 1.  Ideally I would like to get 03/24/12.  If anyone can help me get this result, it would be very much appreciated.


-------------
Thank you,
Rhonda



Replies:
Posted By: CircleD
Date Posted: 26 Mar 2012 at 1:20am
In the Select Expert Formula Field:

tonumber({Table.Field})>=datediff('d',date(1916,1,1),currentdate)


Posted By: kostya1122
Date Posted: 26 Mar 2012 at 5:32am
try a formula  @date
date(mid({Table.Field},4,2)+"/"+left({Table.Field},2)+"/"+mid({Table.Field},2,2))


Posted By: Rhonda
Date Posted: 26 Mar 2012 at 6:20am
Thank you for the reply.  It returns a true or false result, and no date.
 
tonumber({Table.Field})>=datediff('d',date(1916,1,1),currentdate)


-------------
Thank you,
Rhonda


Posted By: Rhonda
Date Posted: 26 Mar 2012 at 6:26am
Thank you very much, however, I am receiving an error 'a string is required here'
 
date(mid({Table.Field},4,2)+"/"+left({Table.Field},2)+"/"+mid({Table.Field},2,2))  


-------------
Thank you,
Rhonda


Posted By: kevlray
Date Posted: 26 Mar 2012 at 6:31am
I answered your post in the Announcements section.


Posted By: kostya1122
Date Posted: 26 Mar 2012 at 6:33am
replace the {Table.Field} with yours if you have then
try
date(mid(totext({Table.Field}),4,2)+"/"+left(totext({Table.Field}),2)+"/"+mid(totext({Table.Field}),2,2))  


Posted By: Rhonda
Date Posted: 26 Mar 2012 at 8:17am
Thank you again, Kostya1122, but it did not work either.  I did recieve a formula from Kevlray, which did work.  So the day has been saved after all.
 
Your posts were very much appreciated.


-------------
Thank you,
Rhonda



Print Page | Close Window