add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table table1 (calendar_day DATE, plant varchar(3), stocks int)

insert into table1 (calendar_day, plant, stocks) values
('20240316', 'ABC', 100),
('20240511', 'DEF', 850),
('20240508', 'GHI', 520),
('20240105', 'JKL', 222)

select * from table1
calendar_day plant stocks
2024-03-16 ABC 100
2024-05-11 DEF 850
2024-05-08 GHI 520
2024-01-05 JKL 222
SELECT
*
FROM
table1
WHERE
DATEPART(YEAR, calendar_day) = DATEPART(YEAR, GETDATE())
AND
DATEPART(MONTH, calendar_day) = DATEPART(MONTH, GETDATE());

calendar_day plant stocks
2024-05-11 DEF 850
2024-05-08 GHI 520
drop table table1