Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Bad Date format Post Reply Post New Topic
Author Message
EdBeau
Newbie
Newbie


Joined: 01 Aug 2014
Online Status: Offline
Posts: 2
Quote EdBeau Replybullet Topic: Bad Date format
    Posted: 12 Nov 2014 at 6:30am
Hello,

I am new to this forum. And relatively new to Crystal.

I am using Crystal 11. I need to get a count of tickets that were closed within 3 days. I have a {ClosedDate} field that is a string. I am not sure the plan of attack to take here.

I have tried creating a formula to convert the string to a date and then to the correct date format seen below.

If datediff("d", cdate(ToText(cDate({CallLog.ClosedDate}),"MM/dd/yyyy")),cdate(ToText(cDate({?Date T0}),"MM/dd/yyyy"))) >3 then "1" else "0"

I also tried simplifying it to (Date({CallLog.ClosedDate}) = (CurrentDate-3))

None of which are working for me. I hope this is clear. Its hard to relay something when you arent really sure what you are talking about.

Any help would be great!! Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Nov 2014 at 8:09am

partially depends on what your strings look like and if they also have time involved and that is a factor and what you mean by 3 days? 3 days from what? your paramter field? Today? A start date in the record?

generally speaking it should be something like this
 
datediff('d',date(field1),Date(field2)<=3


Edited by DBlank - 12 Nov 2014 at 8:10am
IP IP Logged
EdBeau
Newbie
Newbie


Joined: 01 Aug 2014
Online Status: Offline
Posts: 2
Quote EdBeau Replybullet Posted: 12 Nov 2014 at 8:36am
I am trying to compare RcvdDate to ClosedDate.

I need to know tickets that were closed within 3 days of the RcvdDate, as well as 5Days, and Greater than 5 days. The format of the date string is YYYY-MM-DD.

When I create a formula like the one mentioned above and add it to a Running total formula I get "Bad Date Format"
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Nov 2014 at 8:44am

datediff('d',(mid(rcvdate,6,2)+'/'+righ(rcvddate,2)+'/'+left(recvddate,4)),(mid(closedate,6,2)+'/'+righ(closedate,2)+'/'+left(closedate,4)))

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.016 seconds.