0

So I'm using a windows script to use Visual Cut to run a report. That report takes in two date parameters (along with additional params). The script was working when I first tested it, but when I went to demonstrate it to a co-worker it stopped. It turns out that Crystal/Visual Cut needed the date parameter in a different format (initially dd/mm/yyyy worked, but now it requires yyyy/mm/dd). How does Crystal decide what format it needs, and how can I make sure my input adapts to that format?

EDIT: Current workaround is to require 'yyyy/mm/dd' format, and I changed the type on the parameters in the report from dates to strings, and then I explicitly call cdate on the values. I just want to know

a) Where the datemask used for date parameters comes from and

b) If passing 'yyyy/mm/dd' to cdate will ever fail (assuming a valid date).

Adam Martin
  • 1,188
  • 1
  • 11
  • 24

1 Answers1

0

Passing string values and converting them to date, time , number etc might be a problem because you have no control over the user settings. Check what is the difference between the default date format on both computers.

Lan
  • 1,335
  • 1
  • 9
  • 14
  • Tests were run on the same computer, but at different dates. – Adam Martin Dec 01 '15 at 18:28
  • Any chance that the dates were with replaceable month and day numbers . For example if the date is 12/05/2015 the system can read as December 5th or May 12th. However , if you try 12/14/2015 there is just one option to get date from this string. – Lan Dec 01 '15 at 18:32
  • I saw your "EDIT". Do you need to use VisualCut or you are just testing it ? Seems like you are trying to adjust your environment to the product instead of the product to work in your environment. – Lan Dec 01 '15 at 18:44
  • No I tested that specifically (also note that mm/dd/yyyy still doesn't work). And yeah, we already have the product deployed for a ton of reports, trying to use it in a way it wasn't quite designed for to improve a workflow issue. Seems to be working okay now, just worried about why the date format seemed to change on me. – Adam Martin Dec 01 '15 at 19:00