3 Replies Latest reply on Feb 28, 2009 11:21 AM by synergy46

    Monthname(getastext(date)) ... not working???

    synergy46

      Title

      Monthname(getastext(date)) ... not working???

      Post

      I have 1 table

      I have 2 fields in that table:

      #1 mnthname (text)

      #2 dater (date)

       

      mnthname: autoenter calculation = monthname(getastext(date)) returns NOTHING

      unless I edit the Dater field and then click out of the record.  It seems that doing so 'refreshes' the mnthname field and it calculates correclty.

       

      The weird thing is that if I do a global field replace, everything is fine.  If I add a record  it also produces the calculation results.

       

      My quesiton is, when I add a calculated field to a table, isn't there a way to get the calculation to take

      pLACE immediaitely for all records WITHOUT doing a REPLACE?

       

      I think there is something pretty basic and fundamenal I am missing but can't see it.

       

      Can you?

       

      Thanks

       

      Ron

       

       

        • 1. Re: Monthname(getastext(date)) ... not working???
          raybaudi
            

          synergy46 wrote:

           

          mnthname: autoenter calculation = monthname(getastext(date)) returns NOTHING

          ...

          isn't there a way to get the calculation to take pLACE immediaitely for all records WITHOUT doing a REPLACE?

           


          Hi synergy

           

          there is a difference from a text field with option of auto-enter a calculation

          AND

          a calculated field, result text.

           

          It seems that you need the last and the calc will be simoly: MonthName ( date )


          • 2. Re: Monthname(getastext(date)) ... not working???
            comment_1
              

            To emphasize Daniele's last point: MonthName() requires a parameter of type Date. In order to evaluate

             

            MonthName ( GetAsText ( Datefield ) )

             

            it is necessary to perform two conversions: first, the explicit conversion of Datefield to text, then an implicit conversion of the result back to date. All that's achieved here is some redundant CPU cycles, contributing to further global warming.

            • 3. Re: Monthname(getastext(date)) ... not working???
              synergy46
                

              Thanks for your help.  You are right.  Changing the field to "calculation" field type updates immediately.   As an old dBase programmer I am used to 'doing everything myself programmatically and I guess that habit is hard to break.   Thank you  again.

               

              Ron

              :smileyvery-happy: