Results 1 to 2 of 2

Thread: How to use the Datediff function?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Location
    Philippines
    Posts
    11

    How to use the Datediff function?

    How to use the datediff function in Crystal reports? i am having a problem on what value shall i put in the intervaltype. the datediff fuction has intervaltype in it with startdatetime and enddatetime. can you teach me how to?

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

    Re: How to use the Datediff function?

    The Interval type argument specifies the unit of Time intervals you want to return. For example the number of days between two dates, the number of hours etc..

    This returns the number of seconds that have elapsed since midnight.

    DateDiff("s",CurrentDate,CurrentDateTime)

    From the Help file.

    intervalType is a String expression that is the interval of time you use to calculate the difference between startDateTime and endDateTime. Possible values can be:

    Code:
    Interval type Description  
    yyyy             Year
    q                  Quarter 
    m                 Month
    y                  Day of year
    d                  Day (both "y" and "d" find the difference in days)
    w                 Number of weeks between startDateTime and endDateTime
    ww               Number of firstDayOfWeek's between startDateTime and endDateTime
    h                 Hour
    n                 Minute
    s                 Second

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