Include javascript-computed values inside SELECT query

Posted by mjmadelo on 24-Apr-2014 21:37

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!

Posted by Sharavan Kumar on 29-Apr-2014 00:48

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

All Replies

Posted by Hari krishna Tirunagari on 25-Apr-2014 00:10

Hi,
 
I believe this is about RollBase API. Can you please post it to the RollBase community.
 
Thanks,
Hari
 
[collapse]
From: mjmadelo [mailto:bounce-mjmadelo@community.progress.com]
Sent: Friday, April 25, 2014 8:08 AM
To: TU.BPM@community.progress.com
Subject: Include javascript-computed values inside SELECT query
 
Thread created by mjmadelo

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!

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Bill Wood on 27-Apr-2014 18:18

WRT "Can you please post it to the RollBase community.?"

I was able to move this from the old (Business Process Management) to Rollbase.

Posted by Sharavan Kumar on 29-Apr-2014 00:48

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

This thread is closed