DatePart


 — —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  — —
Sup­port machine trans­la­tion: http://amzn.to/1Z7d5oc
 — —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  — —















Crys­tal Reports Online Help
Date­Part
Basic and Crys­tal syn­tax.
Over­loads
Date­Part (inter­val­Type, input­Dat­e­Time)
Date­Part (inter­val­Type, input­Dat­e­Time, firstDay­OfWeek)
Date­Part (inter­val­Type, input­Dat­e­Time, firstDay­OfWeek, firstWeekOfYear)
Argu­ments
inter­val­Type a String expres­sion that spe­cifies the part of a date to be returned. Pos­sible val­ues can be:
Inter­val type value Descrip­tion
yyyy Extracts the year
q Quarter (the res­ult is 1, 2, 3 or 4)
m Month (the res­ult 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 res­ult depend­ing on firstDay­OfWeek)
ww Week of year (1 to 53 with firstDay­OfWeek and firstWeekOfYear determ­in­ing the exact days of the first cal­en­dar week of the year)
h Extracts the hour part of the given Dat­e­Time (0 to 23)
n Minute part (0 to 59)
s Second part (0 to 59)

input­Dat­e­Time is the Dat­e­Time value whose part will be extrac­ted.
firstDay­OfWeek is an option­al con­stant used to spe­cify the first day of the week. If not spe­cified, crSunday is assumed. See Day of Week con­stants for more inform­a­tion.
firstWeekOfYear is an option­al con­stant spe­cify­ing the first week of the year. If not spe­cified, the first week is assumed to be the one in which Jan. 1 occurs (crFirstJan1). See First Week of Year con­stants .
Returns
A Num­ber value.
Action
Date­Part returns a Num­ber that spe­cifies a given part of a given date.
Examples
The fol­low­ing examples are applic­able to both Basic and Crys­tal syn­tax:
Date­Part (““d””, #August 15, 1999#)Returns 15.
Date­Part (““m””, #August 15, 1999#)Returns 8.
Date­Part (““n””, #10:35 am#)Returns 35.
Date­Part (““q””, #Septem­ber 29, 1999#)Returns 3 since Septem­ber 29 is in the third quarter of the year.
Date­Part (““ww””, #Septem­ber 14, 1997#)Returns 38 since Septem­ber 14, 1997 is in the 38th week of 1997.
Sup­pose that a com­pany wants to stamp an id num­ber on each of its ship­ments for qual­ity con­trol pur­poses. The id is com­posed of the order id, fol­lowed by a dash, fol­lowed by the week the order was shipped, fol­lowed by the last two digits of the year. Here is an example for­mu­la that pro­duces these ids:
Rem Basic syn­tax
for­mu­la = CStr({Orders.Order ID}, 0, “”””) & “”-”” & _
CStr(DatePart(““ww””, {Orders.Ship Date}), 0) & _
CStr({Orders.Ship Date}, ““yy””)

//Crystal syn­tax
CStr({Orders.Order ID}, 0, “”””) & “”-”” &
CStr(DatePart(““ww””, {Orders.Ship Date}), 0) &
CStr({Orders.Ship Date}, ““yy””)Returns the string ““20823897”” if {Orders.Order ID} is 2082 and {Orders.Ship Date} is Septem­ber 141997.
Com­ments
This func­tion is designed to work like the Visu­al Basic func­tion of the same name.
The Date­Part func­tion with ““yyyy”” inter­val­Type argu­ment is the same as the Year func­tion. Sim­il­arly, the Date­Part func­tion with ““m””, ““d””, ““w””, ““h””, ““n”” and ““s”” inter­val­Type argu­ment is the same as the func­tions Month, Day, Week­day (or Day­OfWeek), Hour, Minute and Second respect­ively. On the oth­er hand, there is no easy altern­at­ive to using the Date­Part func­tion for the ““q””, ““y”” and ““ww”” inter­val­Type argu­ments.
The firstDay­OfWeek argu­ment affects the Date­Part func­tion when the inter­val type argu­ment is ““w”” or ““ww””. For all oth­er inter­val­Type argu­ment val­ues, it is ignored.
The firstWeekOfYear argu­ment affects the Date­Part func­tion only when the inter­val­Type argu­ment is ““ww””. For all oth­er inter­val­Type argu­ment val­ues, it is ignored.
 — —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  —  — –

Pre­vi­ous page Next page
SAP Busi­nessOb­jects
http://www.sap.com/sapbusinessobjects/
Sup­port ser­vices
http://service.sap.com/bosap-support/
Pro­duct Doc­u­ment­a­tion on the Web
http://help.sap.com/



 — —  —  —  —  —  —  —  —  —  —  —  —  —  —  — – — —  —  —  —  —  —  —  —  —  —  —  —  —  —  — – — —  —  —  —  —  —  —  —  —  —  —  —  —  —  — –
Appoġġ ta traduzz­joni awto­matika: http://amzn.to/1Z7d5oc
 — —  —  —  —  —  —  —  —  —  —  —  —  —  —  — – — —  —  —  —  —  —  —  —  —  —  —  —  —  —  — – — —  —  —  —  —  —  —  —  —  —  —  —  —  —  — –

Rap­porti Crys­tal Online Għa­jnuna
Date­Part
Bażiku u Crys­tal sin­tassi.
kariki żejda
Date­Part (inter­val­Type, input­Dat­e­Time)
Date­Part (inter­val­Type, input­Dat­e­Time, firstDay­OfWeek)
Date­Part (inter­val­Type, input­Dat­e­Time, firstDay­OfWeek, firstWeekOfYear)
argu­menti
inter­val­Type espress­joni String li tis­peċi­fika l-parti ta data li għand­ha tiġi rrit­or­nata. Valuri pos­sib­bli jista jkun:
valur tip Inter­vall Deskrizz­joni
ssss Estrat­ti il sena
Kwarti­er Q (ir-riżultat huwa 1, 2, 3 jew 4)
m Xahar (ir-riżultat huwa 1 – 12)
y Jum ta sena (1365 jew 366 fis-sena biżestili)
parti d Jum tad-data (1 sa 31)
Jum w ta ġimgħa (17 bir-riżultat jid­de­pendi fuq firstDay­OfWeek)
ww Ġimgħa tas-sena (1 sa 53 u l firstDay­OfWeek u firstWeekOfYear jid­de­termina l-ġranet eżat­ti tal-ewwel ġimgħa kal­en­dar­ja tas-sena)
h Estrat­ti il-parti siegħa tal-Dat­e­Time mogħti­ja (023)
parti n Minuta (059)
i it-tieni parti (059)

input­Dat­e­Time huwa l-valur Dat­e­Time li parti tiġi estrat­ta.
firstDay­OfWeek huwa kostanti fak­ultat­tiv użati sabiex jiġu ddefin­iti l-ewwel jum tal-ġimgħa. Jekk ma jkunx speċi­fikat, crSunday huwa preżunt. Ara Jum tal-kostanti Ġimgħa għal aktar inform­azz­joni.
firstWeekOfYear huwa kostanti fak­ultat­tiva jis­peċi­fika l-ewwel ġimgħa tas-sena. Jekk ma jkunx speċi­fikat, l-ewwel ġimgħa huwa preżunt li jkun il-wieħed li fih iseħħ Jan­nar 1 (crFirstJan1). Ara ewwel ġimgħa ta kostanti Sena.
denun­zji
Valur Num­ru.
azz­joni
Date­Part pros­pet­ti Num­ru li tis­peċi­fika parti partikolari ta f’data partikolari.
eżem­pji
L-eżem­pji li ġejjin huma app­likab­bli kemm sin­tassi Bażiku u Crys­tal:
Date­Part ( ““d””, #August 15, 1999 #) Denun­zji 15.
Date­Part ( ““m””, #August 15, 1999 #) Denun­zji 8.
Date­Part ( ““n””, # 10: 35 am #) Denun­zji 35.
Date­Part ( ““Q””, #Septem­ber 29, 1999 #) Denun­zji 3 minn Settem­bru 29 fit-tielet kwart tas-sena.
Date­Part ( ““ww””, #Septem­ber 14, 1997 #) Denun­zji 38 sa minn Settem­bru 14, 1997 hija fil-ġimgħa 38 tal-1997.
Ejja ngħidu li kumpan­ni­ja trid tit­tim­bra num­ru ta iden­ti­fikazz­joni fuq kull wieħed mill-merkan­i­ja għal skop­iji­et ta’ kon­troll tal-kwal­ità. Il-id hija kom­posta mill-ord­ni id, seg­wit b’sing, seg­witi mill-ġimgħa d-digri­et kien tras­port­at, seg­wita mill-aħħar żewġ ċifri tas-sena. Hawn­hekk huwa for­mu­la eżem­pju li tip­produċi dawn l-ids:
Rem sin­tassi bażika
for­mu­la = CSTR ({Orders.Order ID}, 0, “”””) u “”-”” & _
CSTR (Date­Part ( ““ww””, {Orders.Ship Data}), 0) & _
CSTR ({Orders.Ship Data}, ““yy””)

// Sin­tassi Crys­tal
CSTR ({Orders.Order ID}, 0, “”””) u “”-”” &
CSTR (Date­Part ( ““ww””, {Orders.Ship Data}), 0) &
CSTR ({Orders.Ship Data}, ““yy””) Denun­zji il-sek­wen­za ““20823897”” jekk {Orders.Order ID} huwa 2082 u {Orders.Ship Data} huwa 14 Settem­bru, 1997.
kum­menti
Din il-fun­z­joni huwa maħsub biex jaħ­dem bħall-fun­z­joni Visu­al Basic ta l-istess isem.
Il-fun­z­joni Date­Part mal-argu­ment ““ssss”” inter­val­Type huwa l-istess bħall-fun­z­joni Sena. Bl-istess mod, il-fun­z­joni Date­Part bi ““m””, ““d””, ““w””, ““h””, ““n”” u ““i”” l-argu­ment inter­val­Type huwa l-istess bħall-fun­z­jon­iji­et Xahar, Jum, week­day (jew Day­OfWeek), Hour, Minuta u t-Tieni rispet­tiva­ment. Min-naħa l-oħra, m’hemm l-ebda altern­at­tiva faċli biex tuża l-fun­z­joni Date­Part għall- ““Q””, ““y”” u ““WW”” argu­menti inter­val­Type.
L-argu­ment firstDay­OfWeek taf­fettwa l-fun­z­joni Date­Part meta l-argu­ment tip inter­vall huwa ““w”” jew ““ww””. Għal kull valuri l-oħra argu­ment inter­val­Type, huwa injor­at.
L-argu­ment firstWeekOfYear taf­fettwa l-fun­z­joni Date­Part biss meta l-argu­ment inter­val­Type huwa ““ww””. Għal kull valuri l-oħra argu­ment inter­val­Type, huwa injor­at.
 — —  —  —  —  —  —  —  —  —  —  —  —  —  —  — – — —  —  —  —  —  —  —  — —