3 Replies Latest reply: May 15, 2014 9:58 AM by Nick Osdale-Popa RSS

    Date Field

    Sandy McQuay

      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[/b]. 

       

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

       

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

       

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

       

      What's up with that????

        • Date Field
          Nick Osdale-Popa

          Try this trick from

          [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=next_topic;f=1;t=000029;go=older"]Tom Whiteside[/url]

           

          [size="1"][ May 18, 2006, 05:29 PM: Message edited by: Todd Niemi ][/size]

          • Date Field
            Tom Whiteside

            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.           

             

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

             

            Best wishes!

             

            Tom Whiteside

            whitesidetom@yahoo.com[/email]

             

            [size="1"][ October 11, 2002, 08:59 PM: Message edited by: Tom Whiteside ][/size]

            • Date Field
              Nick Osdale-Popa

              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