Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step tutorials and online videos.

Click Here To Learn More »

9.10 DatePart()

DatePart( )

The DatePart() function returns a number representing the part of the date that you specify using the interval parameter. These intervals are listed in Table 9-11. Pass the interval as the first parameter and the date as the second parameter.

‘Get the current quarter
Formula = DatePart("q", CurrentDate) ‘Returns a number 1 - 4

Use interval “w” to display the weekday and it returns a number from 1 to 7. By default, Sunday is represented by a 1. The optional third parameter designates which day of the week is considered the first day of the week. If you passed this parameter crMonday, then Sunday is represented by a 7.

Use “ww” to display the week and it returns a number from 1 to 53. By default, the first week is the week that has January 1st in it. Use the optional fourth parameter to designate a different way of determining the first week of the year. There are two other methods to do this. The first is method specifies that the first week is the one with at least four days...

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!