Smartforms View (sending SQL code)

  • 7 April 2014
  • 1 reply
  • 1 view

Badge +8

Hi All

 

Using a smartform list view to retrieve data from a sql table - works fine.

 

One of the columns in the view is date which I'd like to filter by month.
I've added a dropdown to the view so the user can select the month and from that I can get the month number
I then want to pass some sql to the smartobject to run the filter on the data

SELECT * FROM so_whtdata where month (date) = "03" (where 03 is the value I have returned from the dropdown)

The code works fine in the smartobject test but I'm not sure how to pass this in the smartobject in the form.  Basically I just want to pass some raw sql to the smartobject without using any input parameters on the view.  Have tried doing as below but doesnt work.

 

13768i9CC0DDC2680F1FFA.jpg

 

 

Any advice appreciated

 

Paul


1 reply

Badge +6

Hi, 


 


You would be unable to do it that way. Next to the 'Input Mappings' tab, there is a 'Filter' tab - this can be seen in your image attached. On the filter you can apply a filter to filter out the dates with something like 'Date is greater than equals' 01/03/2014 and 'Date is less than equals' 31/03/2014.


 


Hopefully this should work.


 


Regards.

Reply