Ok so i’m trying to return all information in a a month that preceeds the current month. I’m struggling slightly with the format and code. Here is my attempt.
I can provide table structure if needed
SELECT hd.Holiday_desc,
soh.Site_Name,
FROM holiday_details hd
WHERE TRUNC(LAST_DAY(SYSDATE), 'MM' - 1) = TRUNC(hdep.Holiday_Departure, 'MM')
INNER JOIN holiday_departure hdep
ON hd.holiday_code = hdep.holiday_code
Inner join site_visited sv on hd.Holiday_Code = sv.Holiday_code
inner join site_of_holiday soh on sv.Site_code = soh.Site_code
I think you want
You’ll need to learn a bit about the syntax.
'MM' - 1is not going to work, just as having aWHEREclause in the middle of your query. 🙂 Also, there was a comma to many just beforeFROM.