Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step tutorials and online videos.

Click Here To Learn More »

9.08 Date and Time Functions

Date and Time Functions

Table 9-10. Date and Time Functions

Function Name Description
CurrentDate, CurrentTime, CurrentDateTime
Returns the current date and/or time. DateSerial(year, month, day),
DateTime(hour, minute, second) Returns a date or time.
DateAdd(interval, number, date) Increases the date by a certain interval.
DateDiff(interval, startdate, enddate, firstdayofweek) Find the difference between two dates.
DatePart(interval, date, firstdayofweek, firstweekofyear) Return a number representing the current interval of a date.
MonthName(date, abbreviate) Return the full month name. Return the 3-letter abbreviation if the second parameter is True.
Timer The number of seconds that have elapsed since midnight.
WeekDay(date, firstdayofweek) Return a number representing the day of the week.
WeekdayName(weekday, abbreviate, firstdayofweek) Return the full month name. Return the 3-letter abbreviation if the second parameter is True.

Table 9-11. Interval Strings for DateAdd(), DateDiff() and DatePart()

String Description
“yyyy” Year
“q” Quarter
“m” Month (1 through 12)
“ww” Week of the year (1 through 53)
“w” Day of the week (1 through 7)
“y” Day of year (1 through 366)
“d” Day part of the date (1 through 31)
“h” Hour
“n” Minute
“s” Second

The date and time functions that come with .NET pale in comparison to what you can do with Crystal Reports. Although many of the Basic syntax functions are similar to their .NET counterparts, they give you more functionality. You can also combine different functions together...

Get UNLIMITED Crystal Reports Online Training!

Click Here To Start Your Training!

1500+ Tutorial Pages

Complete Crystal Reports Online Training with over 1,500 pages of better than book quality Crystal Reports tutorials.

Step-by-step Online Videos

Learn at your own pace from the comfort of your home! Pause, rewind and watch online training videos anytime!

Online Community

Members-only community where you can post and answer questions. The community is checked on a regular basis by best selling Crystal Reports book author Brian Bischof to help answer your questions.

Cut & Paste Source Code

Save time with simple cut and paste source code you can use right now in your next report!

Click Here To Start Your Training!