What week of the year

# Thread: What week of the year

1. Senior Member
Join Date
Dec 1969
Posts
205

## What week of the year

Is there a function that will find out what week of the year we are in?<BR><BR>Thanks

2. Senior Member
Join Date
Dec 1969
Posts
7,686

## Yes <eop>

.

3. Senior Member
Join Date
Dec 1969
Posts
205

## RE: Well????? <eop>

-

4. Senior Member
Join Date
Dec 1969
Posts
7,686

## Datepart

DatePart(interval, date[,firstdayofweek[, firstweekofyear]])<BR><BR>for week of year the interval is "ww"<BR><BR>

5. Senior Member
Join Date
Dec 1969
Posts
205

## RE: Datepart

I dont quite understand that.. could you explain it a little bit.. like what value is interval? Do i have to find out the firstdayofweek and firstweekofyear first?<BR><BR>Thanks

6. Senior Member
Join Date
Dec 1969
Posts
7,686

## RE: Datepart

DatePart Function<BR> <BR><BR>Returns a Variant (Integer) containing the specified part of a given date.<BR><BR>Syntax<BR><BR>DatePart(interval, date[,firstdayofweek[, firstweekofyear]])<BR><BR>The DatePart function syntax has these named arguments:<BR><BR>Part Description <BR>interval Required. String expression that is the interval of time you want to return. <BR>date Required. Variant (Date) value that you want to evaluate. <BR>firstdayofweek Optional. A constant that specifies the first day of the week. If not specified, Sunday is assumed. <BR>firstweekofyear Optional. A constant that specifies the first week of the year. If not specified, the first week is assumed to be the week in which January 1 occurs. <BR><BR><BR>Settings<BR><BR>The interval argument has these settings:<BR><BR>Setting Description <BR>yyyy Year <BR>q Quarter <BR>m Month <BR>y Day of year <BR>d Day <BR>w Weekday <BR>ww Week <BR>h Hour <BR>n Minute <BR>s Second <BR><BR><BR>The firstdayofweek argument has these settings:<BR><BR>Constant Value Description <BR>vbUseSystem 0 Use the NLS API setting. <BR>vbSunday 1 Sunday (default) <BR>vbMonday 2 Monday <BR>vbTuesday 3 Tuesday <BR>vbWednesday 4 Wednesday <BR>vbThursday 5 Thursday <BR>vbFriday 6 Friday <BR>vbSaturday 7 Saturday <BR><BR><BR>The firstweekofyear argument has these settings:<BR><BR>Constant Value Description <BR>vbUseSystem 0 Use the NLS API setting. <BR>vbFirstJan1 1 Start with week in which January 1 occurs (default). <BR>vbFirstFourDays 2 Start with the first week that has at least four days in the new year. <BR>vbFirstFullWeek 3 Start with first full week of the year. <BR><BR><BR>Remarks<BR><BR>You can use the DatePart function to evaluate a date and return a specific interval of time. For example, you might use DatePart to calculate the day of the week or the current hour.<BR><BR>The firstdayofweek argument affects calculations that use the "w" and "ww" interval symbols.<BR><BR>If date is a date literal, the specified year becomes a permanent part of that date. However, if date is enclosed in double quotation marks (" "), and you omit the year, the current year is inserted in your code each time the date expression is evaluated. This makes it possible to write code that can be used in different years.<BR><BR>Note For date, if the Calendar property setting is Gregorian, the supplied date must be Gregorian. If the calendar is Hijri, the supplied date must be Hijri.<BR><BR>The returned date part is in the time period units of the current Arabic calendar. For example, if the current calendar is Hijri and the date part to be returned is the year, the year value is a Hijri year.<BR><BR>

7. Senior Member
Join Date
Dec 1969
Posts
205

## Now i get it.. thanks <eop>

..

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•