DatePart ফাংশনটি একটি তারিখের উল্লেখিত অংশ প্রদান করে থাকে।
Syntax:
DatePart (interval As String, date As Date [, firstDayOfWeek As Integer [, firstWeekOfYear As Integer]]) As Long
প্রদান মান:
The extracted part for the given date.
Parameters:
interval - A string expression from the following table, specifying the date interval.
interval (string value)
ব্যাখ্যা
yyyy
বছর
q
চতুর্থাংশ
m
মাস
y
বছরের দিন
w
কর্মদিবস
ww
বছরের সপ্তাহ
d
দিন
h
ঘন্টা
n
মিনিট
s
সেকেন্ড
date - The date from which the result is calculated.
Date literals allow to specify unambiguous date variables that are independent from the current language. Literals are enclosed between hash signs #. Possible formats are:
#yyyy-mm-dd#
#mm/dd/yyyy#
firstdayofweek: An optional parameter that specifies the starting day of a week.
firstdayofweek value
ব্যাখ্যা
0
সিস্টেমের ডিফল্ট মান ব্যবহৃত হয়
1
রবিবার (ডিফল্ট)
2
সোমবার
3
মঙ্গলবার
4
বুধবার
5
বৃহস্পতিবার
6
শুক্রবার
7
শনিবার
firstweekofyear: An optional parameter that specifies the starting week of a year.
firstweekofyear value
ব্যাখ্যা
0
সিস্টেমের ডিফল্ট মান ব্যবহৃত হয়
1
বছরের ১ম সপ্তাহটি হলো ১লা জানুয়ারি সম্বলিত সপ্তাহ (ডিফল্ট)
2
সপ্তাহ ১ হলো সেই বছরের চার অথবা ততোধিক দিন বিশিষ্ট প্রথম সপ্তাহ
3
সপ্তাহ ১ হলো নতুন বছরের শুধুমাত্র দিন বিশিষ্ট প্রথম সপ্তাহ
Example:
Sub example_datepart
MsgBox DatePart("ww", #01/02/2005#) ' displays 2 because weeks start on Sunday
MsgBox DatePart("ww", #12/31/2005#) ' displays 53
MsgBox DatePart(date:=#2005-12-30#, interval:="q") ' displays 4
End Sub