how can I create a table based on the output of previous queries? I tried Create table as select distinct syntax but it doesn't work. ps: the previous queries contain inner join SET dateformat dmy
select distinct c.peril, c.period, c.eventid, c.eventdate, c.loss_index_2016,
c.loss_index_20182019, a.eventdatetime, b.region, a.year,a.eventid
from RetroNCTJan2019v5 a
inner join retropltheader2019v5 b
on a.segmentid=b.segmentid
inner join Index2019 c
on b.region = c.peril and a.Year = c.period and
a.eventid=convert(numeric(30,0),convert(float(28),c.eventid)) and
month(eventdate) = month(eventdatetime) and day(eventdate)=day(eventdatetime)