I am trying to build a query using scripting.
The main problem is with the Select portion.
this works:
selectedQuarter = -1
query = “SELECT DATEADD(QUARTER, DATEDIFF(QUARTER, 0, GETDATE()) -1, 0)”
rows = system.db.runQuery(query,‘historian’)
for row in rows:
startDate = row[0]
print startDate
query = “SELECT DATEADD(QUARTER, DATEDIFF(QUARTER, 0, GETDATE()), -1)”
rows = system.db.runQuery(query,‘historian’)
for row in rows:
endDate = row[0]
print endDate
print selectedQuarter
this doesn’t:
selectedQuarter = int(event.source.parent.getComponent(‘Numeric Text Field’).intValue
query = “SELECT DATEADD(QUARTER, DATEDIFF(QUARTER, 0, GETDATE()) [selectedQuarter], 0)”
rows = system.db.runQuery(query,‘historian’)
for row in rows:
startDate = row[0]
print startDate
query = “SELECT DATEADD(QUARTER, DATEDIFF(QUARTER, 0, GETDATE()), -1)”
rows = system.db.runQuery(query,‘historian’)
for row in rows:
endDate = row[0]
print endDate
print selectedQuarter
Any thoughts?