PDA

View Full Version : Date Field


Sandy McQuay
October 10th, 2002, 05:16 PM
I have a date field on a report in 10/02/2002 format. I want to output 20021002.

If I set the Field Property Type=Character, Format=General, Display Width=10, Template Width=10, I get 10/02/2002.

If I set Field Property Type=Date, Format=General, Display Width=8, Template Width=8, I get 20201002.

If I set Field Property Type=Date, Format=General, Display Width=10, Template Width=10, I get 20021002.

If I set Field Property Type=Date, Format=General, Display Width=9, Template Width=9, I get "-" (sans quotes).

What's up with that????

Nick Osdale-Popa
October 11th, 2002, 02:20 PM
Try this trick from
Tom Whiteside (http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=next_topic;f=1;t=000029;go=olde r)

[ May 18, 2006, 05:29 PM: Message edited by: Todd Niemi ]

Tom Whiteside
October 11th, 2002, 04:57 PM
Sandy, I think you actually just wanted to know why the wacky results were coming up for the different settings.

Your original date field has ten alphanumerics - - eight integers and two character symbols (the two slashes). In your four examples:

Your first example does a straight translation of your 10/02/2002 date field to a ten character wide text field. No changes or alterations.

Your second example only uses a template width of eight, and thereby just captures 10/02/20 - - dropping the last two digits of 02. Monarch's default Y2K date logic takes an apparent year of "20" and translates it to "2020." Therefore, you are left with "20201002."

Your third example is what you wanted. The template width of ten captures all ten alphanumerics of your date and displays it in your desired format, namely, "20021002."

Your fourth example only uses a template width of nine, and thereby just captures 10/02/200 - - dropping the last digit of 2. Now, intelligent as Monarch is, the year range it can catch in a yyyy format is 1601 to 2100. In a year format of yy, it can catch 1900 to 2098. In any case, a year of 200 is quite beyond it's recognition. Since it can make no sense of this date, I think you would see "---------" regardless of the display width.

Hope this all makes sense. At least you have your proper solution in your third example. :D

Thanks for the advertising, Nick! As always, your check is in the mail! tongue.gif

Best wishes!

Tom Whiteside
whitesidetom@yahoo.com

[ October 11, 2002, 08:59 PM: Message edited by: Tom Whiteside ]

Nick Osdale-Popa
October 11th, 2002, 08:07 PM
Ahh, I didn't actually delve into the problem, thought it had something to do with the way Monarch displays it's dates, hence the direction to your suggestion.

Nick [patiently anticipating the check] ;)