WEEKDAY macro

The WEEKDAY macro is available only in HCL® Campaign.

Syntax

WEEKDAY(data [, conversion_keyword])

Parameters

data

The ASCII text dates to convert to numerical values representing days of the week (1-7). This can be ASCII text in quotes, a column of text, a cell range containing text, or an expression evaluating to any of the above. For the format definition of data, see the "Macro Function Parameters" section in the chapter in this guide for your HCL product.

conversion_keyword

This optional keyword specifies how to interpret text formats for dates and times. Select one of the following:

1 - mm/dd/yy (default)

2 - dd-mmm-yy

3 - mm/dd/yy hh:mm

If this parameter is not specified, the default is 1.

Description

WEEKDAY converts text values in the specified data range into numerical values representing days of the week using the specified format for converting dates and times. The number 0 for Sunday, a 1 for Monday, and so on up to 6 for Saturday. If a text string cannot be parsed using the specified conversion_keyword, WEEKDAY will return an error.

Examples

TEMP = WEEKDAY("1/1/95")

Creates a new column named TEMP containing the number 0 (January 1, 1995 is a Sunday).

TEMP = WEEKDAY(V1, 2)

Creates a new column named TEMP containing numbers for the days of the week for the text strings in column V1. All text strings in column V1 are expected to be of the form dd-mmm-yy (otherwise ??? 's are returned).

TEMP = WEEKDAY(V1:V3, 3)

Creates three new columns named TEMP, VX, and VY. The column TEMP contains numbers representing the days of the week of text strings in column V1. The column VX contains numbers representing the days of the week of text strings in column V2. The column VY contains numbers representing the days of the week of text strings in column V3. All text strings in columns V1 - V3 are expected to be of the form mm/dd/yy hh:mm (otherwise ??? 's are returned).

TEMP = WEEKDAY(V1[10:20]:V2, 10)

Creates two new columns named TEMP and VX. The column TEMP contains the numbers representing the days of the week of text strings in rows 10-20 of column V1. The column VX contains the numbers representing the days of the week of text strings in rows 10-20 column V2. All text strings are expected to be of the form mm/dd/yy (otherwise ??? 's are returned).

Related functions

Function Description
NUMBER Converts ASCII text strings for times and dates to numerical values