hi guys, i have a control application with select statement returns many values… i want to display them in between 2 dates… i created 2 dates and works fine but i want to display them after the submission of date only…
currently, i put the sql statement in the onValidate even and it works and created another field to display the values as label… but it is displayed whatever the start-date and end-date are… i want them only to be displayed if the dates are selected…
one more issue, once clicking the “ok” button it doesn’t calcuate the sql directly, it needs second click to calculate!! any idea!?
my code
$start={startdate};
$end={enddate};
sc_lookup(data, " SELECT count(distinct(customer)) as customer,
count(distinct case when video = 1 then customer) as video1,
count(distinct case when video = 2 then customer end) as video3,
count(distinct case when video = 3 then customer end) as video4,
count(distinct case when video = 4 then customer end) as video5,
count(distinct case when video = 5 then customer end) as video6,
count(distinct case when video = 6 then customer end) as video7
FROM my_table
WHERE date(date_field) BETWEEN '$start' AND '$end'");
[customer] ={data[0][0]};
[video1] ={data[0][1]};
[video2] ={data[0][2]};
[video3] ={data[0][3]};
[video4] ={data[0][4]};
[video5] ={data[0][5]};
[video6] ={data[0][6]};
[video7] ={data[0][7]};
how to display the data after selecting the date fileds only? using control application? i created second block for data display and put the global variable as html in label field… but not sure why the data is still lappearing even i tried on validateSuccess event
as there better approach for this?