Weekday() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns an integer from 1 to 7, indicating the weekday of a specified date. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

Weekday( date_expr )

date_expr is a date expression.

Return Value

SmallInt value from 1 to 7, inclusive; 1 represents Sunday.

Description

The Weekday() function returns an integer representing the day-of-the-week component (one to seven) of the specified date.

The Weekday() function only works for dates on or after January 1, in the year 100. If date_expr specifies a date before the year 100, the Weekday() function returns a value of zero.

Example

If Weekday( CurDate() ) = 6 Then
	'
	' then the date is a Friday 
	' 
End If

See Also:

CurDate() function, Day() function, Month() function, Year() function