Use Crystal Report to get the Current Date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • squrel
    New Member
    • Jan 2008
    • 143

    Use Crystal Report to get the Current Date

    I need to create a field in formula field of crystal report (8.5) to get the current date according to my AmendNo field in the report...

    '[AmendDate: ' + Trim(ToText({v_ pohdr.AmendDate },0)) +']'

    I m putting this formula but is telling me the string is required

    Need Help
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Try This :

    '[AmendDate: ' + ToText({v_pohdr .AmendDate}) + ']'

    You had given ToText(Fieldnam e, 0), This will be usefull if Fieldname is Decimal Variable,
    0 -refers to Round-Off. and it gives error for Dates

    Regards
    Veena

    Comment

    • squrel
      New Member
      • Jan 2008
      • 143

      #3
      My field is AmendDate and the format is datetime.... this formula is not giving any error but i m not getting the date... the field is empty



      Originally posted by QVeen72
      Hi,

      Try This :

      '[AmendDate: ' + ToText({v_pohdr .AmendDate}) + ']'

      You had given ToText(Fieldnam e, 0), This will be usefull if Fieldname is Decimal Variable,
      0 -refers to Round-Off. and it gives error for Dates

      Regards
      Veena

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Can you give us the specific details of the error please?

        Comment

        • squrel
          New Member
          • Jan 2008
          • 143

          #5
          i have a report in crystal report... thr is a field called AmendNo which can be 0,1 or 2.. i Have to create a new field called AmendDate which has to be current date and appear when the AmendNo is 1 or 2..
          i made a new column in my table which the AmendNo is taking from and add the column to my view which is using in my report and add the AmendDate where ever the AmendNo is thr in my VB program...
          i made the AmendDate field in my report throug the above formula but the field is empty and not showing any date...
          Can u help me out?

          Comment

          • QVeen72
            Recognized Expert Top Contributor
            • Oct 2006
            • 1445

            #6
            Hi,

            So, you want to print Date if AmendNo > 0 , then put the condition in formula:

            [code=vb]
            If {v_pohdr.AmendN o} > 0 Then
            [AmendDate: ' + ToText({v_pohdr .AmendDate}) + ']'
            Else
            ' '
            [/code]

            Also Check this option > "Convert Null To Defaults"
            After placing the formula, Also Check the Physical width of the Formula..


            Regards
            Veena

            Comment

            • squrel
              New Member
              • Jan 2008
              • 143

              #7
              Thank u very much for ur help

              this formula works but dont convert the Null to Default

              If {v_pohdr.AmendN o} > 0 Then
              'Convert Null To Defaults'

              Comment

              • QVeen72
                Recognized Expert Top Contributor
                • Oct 2006
                • 1445

                #8
                Hello,

                I Told You To Check The Cr Option In Designer..

                Regards
                Veena

                Comment

                • squrel
                  New Member
                  • Jan 2008
                  • 143

                  #9
                  Ya sorry ... got it
                  thankx alot for ur help.... God Bless

                  Comment

                  Working...