Skip to Content
0
Former Member
Nov 28, 2016 at 12:45 PM

How can I set a where clause for getting the date dynamically in XSJS ?

256 Views

Hi ,

I am facing the issue of getting some data based on a date filter.

Hence, I need to provide the date in the where clause. I'v tried these till now ---

1. var query = 'SELECT DISTINCT \"StationId\",\"Status\" FROM \"***********************************************\" WHERE \"StartDate\" = \'CURRENT_DATE\'';

2. var query =

'SELECT DISTINCT \"StationId\",\"Status\" FROM \"***********************************************\" WHERE \"StartDate\" = \'GetDate()\'';

The other option was to write a new xsjs to get the date as output & modify it accordingly. I did that as well.

But, the problem lies in passing a variable within a where clause/ getting the date dynamically in where clause.

Please, suggest a solution.

Thanks a Lot,

Sudipta