Discussion Locked

Crystal Rpt 7: Calculating the Date Diff

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

I have done my first 2 days worth of Crystal Reports. So, my question will probably seem a little basic.

I have created a report against a database in which a field ({Asgnmnt.TargetDate})exists as a String type.

I tried calculating this date against CurrentDate in this fashion:

DTSToDate{Asgnmnt.TargetDate})-CurrentDate.

However, the result was always "0".

So, I posted only the DTSToDate({Asgnmnt.TargetDate})and discovered that the value yielded was a blank.

I am using CRW 7.0.1.192.

As stated earlier I am a novice at this so please be gentle. :)

Thanks,
Neeva Candida

3 replies

by raffi_

I don't know why Seagate fusses so much over their date/time values. They seem to break it every other version.

DTSToDate can only convert strings that are in the format 'YYYY/MM/DD or 'YYYY/MM/DD HH:MM.SS'. If it is any other format you will receive zero results. You must parse the string extracting the values as you go. A full (fuller than I can reasonably type) explanation is available here:

http://support.crystaldecisions.com/kbase/c2005509.asp?AJID=88A55780A44B234297941F2FF0FCE5D6As usual, make sure that there are no spaces in the above URL.

Regards
Raffi_

by neeva

Hello,

Although your answer didn't actually lead to the resolution I was hoping for it was the only one I received from this board.

I subsequently found the answer I needed on another message board's forum.

However, in appreciation for youreffort...

Thanks,
Neeva Candida

This discussion is closed to new replies.