Official Content

Extracts the number that indicates the day in a given date. If the received parameter is null, the value returned is 0.

Syntax

Day(date-expression | datetime-expression)

Type Returned:
Numeric(2)


Scope

Objects:    Procedure, Transaction, Web PanelPanelData Provider
Generators: .NET, .NET Framework, Java, Apple, Android, Angular


Samples

A company wants to implement the following discount policy: All debts paid before the 21st of every month will have a 15% discount.

Consider the following Transaction object:

Payment 
{ 
   PaymentId* 
   PaymentDate 
   PaymentAmount     
}

The following code is defined inside an Event of the Payment Transaction or a Web Panel with base table: 

If day(PaymentDate) < 21
   &Discount = PaymentAmount * 0.15
else
   &Discount = 0
EndIf

See Also

TimeZone Support - General Considerations
Day method
Month function
Year function

  

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