Home : Products : Hach WIMS : Hach WIMS Client : Documentation : Function Reference : Spread Functions : Primitive Functions : WEEKDAY
Q11615 - INFO: WEEKDAY

WEEKDAY (Primitive Spread Function) returns the day of the week corresponding to a date.

SYNTAX:

WEEKDAY(date,type)

REMARKS:

Arguments are as follows:

Argument Description 
date Date for which you want to determine the day of the week provided as a Date Serial Number
type (Optional) Number that represents the numbering scheme for the returned day value.
Can be one of the following: 
 Value                                            Number returned 
 1 (assumed if omitted)                    Numbers 1 (Sunday) through 7 (Saturday) 
 2                                                   Numbers 1 (Monday) through 7 (Sunday) 
 3                                                   Numbers 0 (Monday) through 6 (Sunday) 


Specify the date as a serial value or date value using the date argument. To provide a serial value from a date string, use the VAL function.

The returned day of the week is given as an integer, ranging from 0 to 6 or 1 to 7, depending on the setting of the type argument.

Spread's calc engine processes dates as a numeric value in the form x.y, where x is the "number of days since December 30, 1899" and y is the fraction of day. Numbers to the left represent the date, which is the value that the DATE function returns. Use the TIME function to return the serial value for the time value (the fraction of a day).

Date values are based on the number of days elapsed since December 30, 1899, which has a date serial value of Day 0. For example, December 31, 1899 has a date serial value of 1. Date values prior to December 30, 1899 have negative date serial values. For example, the date value December 29, 1899 has a date serial value of –1.

 

EXAMPLES:

WEEKDAY(A2)
WEEKDAY(36828) = 1 which is equivalent to Sunday
WEEKDAY(VAL("5/9/2024") = 5 as May 9th is a Thursday

Related Articles
Q11523 - INFO: DAY
Q11560 - INFO: MINUTE
Q11563 - INFO: MONTH
Q11567 - INFO: NOW
Q11589 - INFO: SECOND
Q11607 - INFO: TIME
Q11608 - INFO: TODAY

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 8/28/2008 4:21 PM.
Last Modified on 5/9/2024 8:51 AM.
Last Modified by Scott Dorner.
Article has been viewed 2787 times.
Rated 0 out of 10 based on 0 votes.
Print Article
Email Article