Hi all!
I like to do a query on my inventory table within a specific date range (using rbv_api.selectQuery). The date range is input by the user via a bootstrap datepicker. Is there a way that I can use the input dates inside my SELECT query?
For example, something like this query:
rbv_api.selectQuery(SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2);
where column_name is the inventory date, value1 and value2 are the dates input by the user via datepicker.
Any help will be very much appreciated! Thank you!
Hi ,
You may use the query ' rbv_api.selectQuery() ' as below , which will query on records that falls BETWEEN a specific DATE range
example:
var d1 = new Date('2/20/2014');
var d2 = new Date('4/28/2014');
var arr = rbv_api.selectQuery("SELECT id, name FROM a1 WHERE createdAt BETWEEN ? AND ?", 100, d1, d2);
rbv_api.printArr(arr);
Hope you find this useful.
Thanks,
Sharavan
Hi all!
I like to do a query on my inventory table within a specific date range (using rbv_api.selectQuery). The date range is input by the user via a bootstrap datepicker. Is there a way that I can use the input dates inside my SELECT query?
For example, something like this query:
rbv_api.selectQuery(SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2);
where column_name is the inventory date, value1 and value2 are the dates input by the user via datepicker.
Any help will be very much appreciated! Thank you!
Flag this post as spam/abuse.
WRT "Can you please post it to the RollBase community.?"
I was able to move this from the old (Business Process Management) to Rollbase.
Hi ,
You may use the query ' rbv_api.selectQuery() ' as below , which will query on records that falls BETWEEN a specific DATE range
example:
var d1 = new Date('2/20/2014');
var d2 = new Date('4/28/2014');
var arr = rbv_api.selectQuery("SELECT id, name FROM a1 WHERE createdAt BETWEEN ? AND ?", 100, d1, d2);
rbv_api.printArr(arr);
Hope you find this useful.
Thanks,
Sharavan