LibreOffice Module connectivity (master) 1
Protected Member Functions | List of all members
connectivity::file::OOp_Week Class Reference

WEEK(date) WEEK(date,first) With a single argument, returns the week for date, in the range 0 to 53 (yes, there may be the beginnings of a week 53), for locations where Sunday is the first day of the week. More...

#include <FDateFunctions.hxx>

Inheritance diagram for connectivity::file::OOp_Week:
[legend]
Collaboration diagram for connectivity::file::OOp_Week:
[legend]

Protected Member Functions

virtual ORowSetValue operate (const std::vector< ORowSetValue > &lhs) const override
 
virtual ORowSetValue operate (const std::vector< ORowSetValue > &lhs) const =0
 

Additional Inherited Members

- Public Member Functions inherited from connectivity::file::ONthOperator
virtual void Exec (OCodeStack &) override
 
virtual void Exec (OCodeStack &)=0
 
- Public Member Functions inherited from connectivity::file::OCode
virtual ~OCode ()
 
 OCode (OCode &&)=default
 
 OCode (const OCode &)=default
 
 OCode ()=default
 
OCodeoperator= (const OCode &)=default
 
OCodeoperator= (OCode &&)=default
 

Detailed Description

WEEK(date) WEEK(date,first) With a single argument, returns the week for date, in the range 0 to 53 (yes, there may be the beginnings of a week 53), for locations where Sunday is the first day of the week.

The two-argument form of WEEK() allows you to specify whether the week starts on Sunday or Monday and whether the return value should be in the range 0-53 or 1-52. Here is a table for how the second argument works: Value Meaning 0 Week starts on Sunday and return value is in range 0-53 1 Week starts on Monday and return value is in range 0-53 2 Week starts on Sunday and return value is in range 1-53 3 Week starts on Monday and return value is in range 1-53 (ISO 8601)

‍SELECT WEEK('1998-02-20'); -> 7 SELECT WEEK('1998-02-20',0); -> 7 SELECT WEEK('1998-02-20',1); -> 8 SELECT WEEK('1998-12-31',1); -> 53

Definition at line 133 of file FDateFunctions.hxx.

Member Function Documentation

◆ operate()

ORowSetValue OOp_Week::operate ( const std::vector< ORowSetValue > &  lhs) const
overrideprotectedvirtual

Implements connectivity::file::ONthOperator.

Definition at line 198 of file FDateFunctions.cxx.

References Date::GetWeekOfYear(), and SUNDAY.


The documentation for this class was generated from the following files: