Skip to main content
InSource KnowledgeCenter

027815 - How to provide a dynamic start and end time with direct query in workbook

Problem

In AF workbook client needs to do an aggregate value of count and also provide a dynamic start and end time to "globally" refresh all of his values.

Product Version: 9.2

ProdSp: SP1

OS: Win 2003

OS_SP: SP2

Solution

you have to use the direct query in AF workbook to get the "count" aggregate value. to provide the dynamic start and end time you have to use the concatenate function. ex. =CONCATENATE("SELECT TagName = at.TagName, 'Count' = Count(ah.Value) FROM AnalogTag at,v_AnalogHistory ah WHERE DateTime >= '",H12,"' AND DateTime <= '",I12,"' AND ah.TagName in ('Step-AseptPast3StepNum') AND ah.Value = 169 AND ah.TagName = at.TagName AND wwEdgeDetection = 'LEADING' AND wwRetrievalMode = 'Delta' AND wwRowCount = 0 AND wwVersion = 'LATEST' GROUP BY at.TagName")

Close Date: 2009-06-12 09:19:49