Hi,

i created a trigger for inserting a data. Now i use to fetch data by using select query, i want to create a csv or excel file while the end of the month, as well as this trigger wants to execute by checking the date compared with month end.

Eg. create or replace trigger [triggername]
BEFORE INSERT ON [tablename]
when(calldatetime == [lastdatetime])
begin
[how to create csv file creation here]
end

[lastdatetime] - want to fetch the date automatically, for example, january - 31, Feburary - 28 , if leap year means -29 , likewise it wants to date

kindly anybody help me, by sharing your ideas.