Date: prev next · Thread: first prev next last
2021 Archives by date, by thread · List index


   I have am using Base to connect to HSQLDB 2.60 so I can use functions like this one. I have this query which calculates my account balances for the last day of the present month.

        SELECT "Data"."Account" "Account", SUM( "Data"."Amount" ) "Account Balance", SUM( "Data"."Budget" ) "Budget" FROM "Data", "Transactions" WHERE "Data"."Transactions_ID" = "Transactions"."Transactions_ID" AND "Transactions"."Date" <= LAST_DAY( CURRENT_DATE ) GROUP BY "Data"."Account" HAVING SUM( "Data"."Amount" ) <> 0 ORDER BY "Account" ASC

   What I want to do is to calculate these values for the last day of the previous month. I thought using DATEADD to calculate them. Even though I select the sql button (run sql directly), Base does not recognize the function. Specifically, I have tried to put the DATEADD functions within LAST_DAY.

        LAST_DAY(DATEADD('mm', 1, CURRENT_DATE)) ought to product the last day of the next month; a -1 should produce the last day of the previous month.

     Help will be much appreciated.

Dan


--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.