DayNumber PowerScript function
Description
Determines the day of the week of a date value and returns
the number of the weekday.
Syntax
|
1 |
<span>DayNumber</span> ( <span>date</span> ) |
|
Argument |
Description |
|---|---|
|
date |
The date value from which you want the |
Return Values
Integer. Returns an integer (1-7) representing
the day of the week of date. Sunday is day
1, Monday is day 2, and so on. If date is null, DayNumber returns null.
Examples
These statements evaluate the date literal 2000-01-31
and set day_nbr to 4 (January 31,
2000, was a Wednesday):
|
1 |
integer day_nbr |
|
1 |
day_nbr = <span>DayNumber</span>(2000-01-31) |
These statements check to be sure the date in sle_date is
valid, and if so set day_nbr to the
number of the day in the sle_date:
|
1 |
integer day_nbr |
|
1 |
|
1 |
IF IsDate(sle_date.Text) THEN |
|
1 |
day_nbr = <span>DayNumber</span>(Date(sle_date.Text)) |
|
1 |
ELSE |
|
1 |
MessageBox("Error", & |
|
1 |
"This date is invalid: " & |
|
1 |
+ sle_date.Text) |
|
1 |
END IF |
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest