SELECT Reason, (
SUM([DTMIN])
FROM vwIG_DownTimeDetailsByPID
WHERE Reason = 'Electrical'
AND ([Trans Date] BETWEEN '2024-01-01' AND '2024-12-31')
GROUP BY Reason),
SELECT SUM([SCH MIN]) (
FROM vwIG_ProductionSummaryReportByDate
WHERE ([PROD DATE] BETWEEN '2024-01-01' AND '2024-12-31')
)
Here is the code I currently have written. I am very new to scripting, and I am sure there are obvious errors. I am getting an incorrect syntax error near the keyword 'FROM.' The main thing I wish to accomplish is to get the values of both parts of this code to display in as separate rows when I execute the code in the testing bit of Named Queries. I tried just stacking the code for two separate named queries but I am only getting the display of the first bit of code executed instead of both. If i could please ask for some insight into this issue. Keep in mind, I have not yet written the part of the code that will do the final calculation (that's a problem for future me.)
ERROR:
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'FROM'.