Official Content

Returns the number associated to a day of the week. (Sunday = 1). The value 0 is returned if the received parameter is null.

Syntax

Date | DateTime.DayOfWeek()

Type returned:
Numeric(1)

Scope

Data Types: DateDateTime

Samples

Consider the following Transaction object:

Purchase
{
  PurchaseId*
  PurchaseDate
  Line
  {
    PurchaseLineId*
    PurchaseLineDescription
    PurchaseLineOriginalPrice
    PurchaseLinePriceWithDiscount
  }
}

If you want to apply a 15% discount for purchases made on Monday or Tuesday, you can define the following Rule in the Purchases Transaction:

PurchaseLinePriceWithDiscount = PurchaseLineOriginalPrice * 0.85 if  &Today.DayOfWeek()=2 or &Today.DayOfWeek()=3; 

See Also

TimeZone Support - General Considerations
Dow function
CDoW function







Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant