Results 1 to 6 of 6

Thread: Crystal Report ?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Crystal Report ?

    I am using Crystal Report 8.5. I am trying to do a computation on a database field. The field is defined as a text field in the form of time; 00:00:34 (34 seconds). What I am trying to do is create a formula that sums the values in this field and I'm not sure how to do this or if it's even possible. The only function I saw that made any sense was the "DateAdd" but I don't believe that will work.

    Hope I've explained myself well enough.

    Thanks,

    -Blake
    Last edited by blakemckenna; Dec 14th, 2006 at 11:51 PM.
    Blake

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Crystal Report ?

    You could use CDate() on the string to convert it to Date type data before you use it in any computation.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Crystal Report ?

    Al,

    I've actually tried that...in fact, here's what the formula looked like:

    Sum(CDate(mElapsedTime))

    It didn't work because it was looking for a number. The format of mElapsedTime is 00:00:34 and it's stored as a Text field in an Access DB.
    Blake

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Crystal Report ?

    Use the CDateTime function. Then convert that into a number.

    DateDiff("s",CDateTime("00:00:00"), CDateTime({mElapsedTime}))

  5. #5

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Crystal Report ?

    Thanks Bruce...I'll give it a try!
    Blake

Posting Permissions

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



Click Here to Expand Forum to Full Width