Showing posts with label datepart. Show all posts
Showing posts with label datepart. Show all posts

Friday, 30 May 2014

Date intervals for VB and Tsql

Date intervals for Sql Server



year yy, yyyy
quarter qq, q
month mm, m
dayofyear dy, y
day dd, d
week wk, ww
weekday dw
hour hh
minute mi, n
second ss, s
millisecond ms

Usage  DATEPART(datepart,date)


Dates for Visual Basic

DateInterval.Day d Day of month (1 through 31)
DateInterval.DayOfYear y Day of year (1 through 366)
DateInterval.Hour h Hour
DateInterval.Minute n Minute
DateInterval.Month m Month
DateInterval.Quarter q Quarter
DateInterval.Second s Second
DateInterval.Weekday w Day of week (1 through 7)
DateInterval.WeekOfYear ww Week of year (1 through 53)
DateInterval.Year yyyy Year
Usage DatePart(DateInterval.Quarter, ActualDate)

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)


Multi Point USB Charger

  USB Plug Charger, 4-Port USB Fast Charger Plug with 33W Intelligent Quick Charge 3.0 Wall Charger, Multi USBPower Adapter UK Fast Charging...