![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB Extensions » View Thread |
Messages 1 to 3 of 3 total |
![]() |
Mon, Feb 6 2012 8:58 AM | Permanent Link |
Lucian | CREATE FUNCTION "IsCurYear" (
IN "ADate" DATE) RETURNS BOOLEAN BEGIN DECLARE Result BOOLEAN DEFAULT False; DECLARE EndDate, StartDate DATE; DECLARE iYear INTEGER; SET EndDate = CURRENT_DATE; SET iYear = EXTRACT(YEAR, EndDate); SET StartDate = CAST(CAST(iYear AS VARCHAR) + '-01-01' AS DATE); IF ADate BETWEEN StartDate AND EndDate THEN SET Result = True; ELSE SET Result = False; END IF; RETURN Result; END DESCRIPTION 'Boolean function to return TRUE if the given date belongs to current year.' |
Wed, Feb 8 2012 3:16 AM | Permanent Link |
David Cornelius Cornelius Concepts | This will do the same...
CREATE FUNCTION "IsCurYear" (IN "ADate" DATE) RETURNS BOOLEAN BEGIN RETURN (EXTRACT(YEAR FROM ADate) = EXTRACT(YEAR FROM CURRENT_DATE)); END DESCRIPTION 'Boolean function to return TRUE if the given date belongs to current year.' David Cornelius Cornelius Concepts |
Wed, Feb 8 2012 7:28 AM | Permanent Link |
Lucian | >This will do the same...
I started I think with IsLastWeek or IsLastMonth, than blindly copy-pasted and adjusted it for the other utilities, without realising there's a simpler way ![]() Thank you for reviewing it, it's much better when it's simple! Lucian |
This web page was last updated on Wednesday, August 14, 2024 at 03:12 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |