public inbox for [email protected]  
help / color / mirror / Atom feed
From: Anthony Apollis <[email protected]>
To: [email protected]
Subject: Calendar Table
Date: Wed, 10 Jul 2024 17:38:12 +0200
Message-ID: <CAJyMCYJAKCB+RTKxddG=hAbyFLQvTF2BuHhfwWvmhb4MTTB3pA@mail.gmail.com> (raw)

I have a Calendar table that need to be displaying Fiscal Start and End
Date as in below:

[image: f1]

The Calendar is currently have data for years 2023 - 2028:

-- Query to get the year and number of days
SELECT
    EXTRACT(YEAR FROM "Date") AS "Year",
    COUNT(*) AS "NumberOfDays"
FROM "Prod"."IMETA_Calendar"
GROUP BY EXTRACT(YEAR FROM "Date")
ORDER BY EXTRACT(YEAR FROM "Date");

--

[image: f5]

When i run code:

-- Query to get the year and number of days
SELECT
    EXTRACT(YEAR FROM "Date") AS "Year",
    COUNT(*) AS "NumberOfDays"
FROM "Prod"."IMETA_Calendar"
GROUP BY EXTRACT(YEAR FROM "Date")
ORDER BY EXTRACT(YEAR FROM "Date");

-- Table creation script
CREATE TABLE "Prod"."IMETA_Calendar" (
    "Date" timestamp NOT NULL,
    "FY" varchar(255),
    "Period" varchar(255),
    "Quarter" varchar(255),
    "Day" int NOT NULL,
    "Month" int NOT NULL,
    "Year" int NOT NULL,
    "Loaddate" timestamp NOT NULL
);

I get some output: [image: f6]

For any other Period and Year i get no results. What is wrong with my
Calendar table. Attached is the Calendar Table Data.

CREATE TABLE [Prod].[IMETA_Calendar](

[Date] [datetime] NOT NULL,

[FY] [nvarchar](255) NULL,

[Period] [nvarchar](255) NULL,

[Quarter] [nvarchar](255) NULL,

[Day] [int] NOT NULL,

[Month] [int] NOT NULL,

[Year] [int] NOT NULL,

[Loaddate] [datetime] NOT NULL

) ON [PRIMARY]


Attachments:

  [application/vnd.openxmlformats-officedocument.spreadsheetml.sheet] Book1.xlsx (89.6K, 3-Book1.xlsx)
  download

  [image/png] f5.png (28.2K, 4-f5.png)
  download | view image

  [image/png] f2.png (129.9K, 5-f2.png)
  download | view image

  [image/png] f1.png (95.9K, 6-f1.png)
  download | view image

  [image/png] f3.png (116.9K, 7-f3.png)
  download | view image

  [image/png] f4.png (123.0K, 8-f4.png)
  download | view image

  [image/png] f6.png (11.5K, 9-f6.png)
  download | view image

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Calendar Table
  In-Reply-To: <CAJyMCYJAKCB+RTKxddG=hAbyFLQvTF2BuHhfwWvmhb4MTTB3pA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox