Hi
Yesterday i got to do with SQL for the first time. I am running a query in SQuirrel and get my data and then copy it to excel. how can i use a macro to do that query directly in excel? my query looks like this.
Yesterday i got to do with SQL for the first time. I am running a query in SQuirrel and get my data and then copy it to excel. how can i use a macro to do that query directly in excel? my query looks like this.
Code:
SELECT DISTINCT NODE, Summary,Firstoccurrence, LastOccurrence, Tally, text
FROM Slas_Report.dbo.NTC_Logging_Data NTC_Logging_Data
WHERE NTC_Logging_Data.Node in ('calypdr1','vcibjnbgtaprd1')
AND ((LASTOCCURRENCE > '2011-09-01 00:00:00') AND (LASTOCCURRENCE < '2011-09-02 00:00:00'))
AND (SEVERITY > 4) AND (Text IS NOT null) AND ( Summary not like '%GT_REPORT%' ) AND (text like '%closed%')
AND (Summary not like '%health OK%') AND (Agent Not like '%Syman%') AND ( AlertGroup Not like '%Ping%' )
AND (Summary not like '%(SPACE)%') AND (Summary not like '%Disk Usage%') AND (Summary not like '%CPU usage%')
AND (Summary not like '%storage volume%') AND (Summary not like '%memory usage%')
--BOT + Goldtier
UNION
SELECT DISTINCT NODE, Summary, Firstoccurrence, LastOccurrence, Tally, text
FROM Slas_Report.dbo.NTC_Logging_Data NTC_Logging_Data
WHERE NTC_Logging_Data.Node in ('10.182.202.106','vcibjnbcognprd1')
AND (Severity = 5) AND ((LASTOCCURRENCE > '2011-09-01 00:00:00') AND (LASTOCCURRENCE < '2011-09-02 00:00:00'))
AND (TEXT IS NOT null) AND (text like '%closed%') AND (Summary not like '%health OK%') AND (Agent Not like '%Syman%')
AND ( AlertGroup Not like '%Ping%' ) AND (Summary not like '%(SPACE)%') AND (Summary not like '%Disk Usage%')
AND (Summary not like '%CPU usage%') AND (Summary not like '%storage volume%') AND (Summary not like '%memory usage%')
--ET