I’m making a call to system.db.runQuery and the query is putting “as” to be able to save in a csv with changed headers and it gives an error in the way it recognizes it. I understand that is how I am writing it.
def CSV(Linea):
import system
from java.util import Date
#*********************** CABECERA *********************
H_t_stamp = “K4”
H_B1 = “VDD/B1”
H_B2 = “VDD/B2”
H_B3 = “VDD/B3”
H_B4 = “VDD/B4”
H_B5= “VDD/B5”
H_B6= “VDD/B6”
H_P1 = “VDD/P12”
H_P2 = “VDD/P2”
H_B1B3 = “VDD/B1B3”
H_B4B6 = “VDD/B4B6”
H_B2B1 = “VDD/B2B1”
H_B5B4 = “VDD/B5B4”
#*******************************************************
now = Date() # creates a new date, for right now
Fecha = system.db.dateFormat(now, “yyyy-MM-dd HH:mm:ss”)
C_CSV = system.db.runQuery("SELECT (t_stamp as H_t_stamp, B1 as H_B1, B2 as H_B2,B3 as H_B3, B4 as H_B4, B5 as H_B5, B6 as H_B6 from Bisagras where t_stamp BETWEEN '2018-05-29 06:00:00' AND '2018-06-30 05:59:59') VALUES(%s,%s,%s,%s,%s,%s,%s)" %(H_t_stamp, H_B1, H_B2, H_B3, H_B4, H_B5, H_B6))
system.dataset.exportExcel("data.csv", 1, C_CSV)