Wonderware InSQL 9.0

Jezz

Member
Join Date
Dec 2002
Location
Kendal
Posts
399
Hi All,

I'm trying to get an event tag to email a report out at a set time but all I can get it to do is email a blank report as soon as I include the query nothing happens

this is the Generic SQL I'm using :

Set Quoted_Identifier OFF
exec master..xp_sendmail
@recipients = "******.******@******.com",
@subject = "Data for @EventTagName at @EventTime",
@query = "SET NOCOUNT ON
DECLARE @StartDate DateTime
DECLARE @EndDate DateTime
SET @StartDate = DateAdd(hh,-24,GetDate())
SET @EndDate = GetDate()
SET NOCOUNT OFF
SELECT Description, DateTime, Value
FROM Tag, v_AnalogHistory
WHERE v_AnalogHistory.TagName IN ('AreaACanlineCaseCountLastHour')
AND Tag.TagName = v_AnalogHistory.TagName
AND wwVersion = 'Latest'
AND wwRetrievalMode = 'Cyclic'
AND wwRowCount = 24
AND DateTime >= @StartDate
AND DateTime
UNION
SELECT Description, DateTime, Value
FROM Tag, ManualAnalogHistory
WHERE ManualAnalogHistory.TagName IN ('AreaACanlineCaseCountLastHour')
AND Tag.TagName = ManualAnalogHistory.TagName
AND DateTime >= @StartDate
AND DateTime
ORDER BY DateTime DESC",
@no_output = "true"


The Query on its own works but it's not working as part of the email.Any ideas welcome
 
Last edited:
You need to remove your email address out of the above posting unless you like getting lots and lots of spam to that address! There are automated 'bots just searching forums like this for publically posted addresses to spam!
 

Similar Topics

Hello All, I am trying to connect to a server using Distributed Name Manager and assigning InSQL Provider for trending purposes. I've set up the...
Replies
1
Views
3,135
Hi everyone, can anyone have a idea how i can update my table data into an Insql Tag. Is there any possibility do that. Please let me know how to...
Replies
0
Views
1,717
Hi folks, I am working with a Wonderware/IndustrialSQL system for the monitoring and analysis of harmful gases. I want to read the samples from...
Replies
4
Views
2,654
I want to set up tags in Intouch that will connect to the system monitor tags within InSQL to monitor the status of the system (running...
Replies
9
Views
5,466
Does anyone have much experience writing WW InSQL queries. I have done a bit of it. There are two different ways to get data from it (it is an...
Replies
3
Views
9,557
Back
Top Bottom