Thursday 29 May 2014

Datepart in Crystal Reports

Crystal Reports datepart is slightly different than  SQL and VB



Interval type            Description
yyyy                          Extracts the year
q                               Quarter (the result is 1, 2, 3 or 4)
m                              Month (the result is from 1 to 12)
y                               Day of year (1 to 365 or 366 in a leap year)
d                               Day part of the date (1 to 31)
w                              Day of week (1 to 7 with the result depending on firstDayOfWeek)
ww                           Week of year (1 to 53 with firstDayOfWeek and firstWeekOfYear determining the exact days of the first calendar week of the year)
h                               Extracts the hour part of the given DateTime (0 to 23)
n                               Minute part (0 to 59)
s                                Second part (0 to 59)



Datepart ("yyyy", your value)


1 comment:

  1. Hello from almost 5 years in the future! Thank you for this list - I've recently returned to writing Crystal reports and was going nuts trying to figure this out.

    ReplyDelete

STADIA Games controller last chance to upgrade.

 Stadia was closed in 2023 by Google due to lack of take up on the system. google did refund people for there purchases and a way to upgrade...