Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Aug 2006
    Thanked 0 Times in 0 Posts

    startswith and replace function (Crystal Reports 10)

    I know you don't have a board for crystal reports but you guys have helped me out before and I think what I'm trying to do is similar to VB.

    I have a field in my report that has a data type of VARCHAR. When I insert it in my report it returns for example 0101 (for January 1st). instead of it returning 0101 I would like it to return "January 01" or whatever the date should be. I have tried using a startswith and replace function to do this but it tells me "the result of the seletion formula must be a boolean" any help would be greatly appreciated. The code I have is posted below. Thanks Jonathan

    if {Field} startsWith "01"
    replace({Field}, "01", "January", 1, 1)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: startswith and replace function (Crystal Reports 10)

    In Access, you'd do something like this:

    =Format(DateSerial(2007, Left([Field], 2), Right([Field], 2)), "mmmm dd")

    No idea what the equiivalent in Crystal Reports would be.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts