Serverside proccesing range search

Serverside proccesing range search

KarlogKarlog Posts: 9Questions: 4Answers: 0
edited September 2017 in Select

Hello

I need to make a date range search in my application, I can see that there are a lot of questions on the forum about this usecase, but I was unable to find a way to achieve this.

I have a date column where I want to be able to get dates between a specific span. (I have custom search by colum up and running)

In SQL it would be something like

SELECT * FROM {table} WHERE {table}.{column} >= minDate AND {table}.{column} <= maxDate;

How would I go around that using Datatables serverside processing?

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    you would add it to what gets sent to the server in the data section of your ajax call.

    so if I have two text boxes (txtStart and txtStop) it wouild look something like

    ajax: {
        url:;asdfkl,
        data:function(dtParms){
           dtParms.minDate = $('#txtStart').val();
            dtParms.maxDate = $('#txtStop').val();
            return dtParms
        }
        
    
    }
    
    

    then server side you can pull out the date and add them to your sql

Sign In or Register to comment.