error occurs when using between condition over date type.

error occurs when using between condition over date type.

Clark SClark S Posts: 27Questions: 8Answers: 0
edited March 2022 in SearchBuilder
"knex": "^1.0.3",
"mssql": "^8.0.2",

conditions like before, after, equal are all working fine, except between.

condition works over formated_date field

node js error

Answers

  • Clark SClark S Posts: 27Questions: 8Answers: 0
    edited March 2022

    btw, serverside set to TRUE.
    and funny as it sounds,
    when selecting the second date first then the first date, most probably the backend works, however, it fails most of the time when picking the first date then the second date,

  • colincolin Posts: 15,202Questions: 1Answers: 2,592
    edited March 2022

    Are you the server-side scripts that we provide? Or have you got your own?

    Colin

  • Clark SClark S Posts: 27Questions: 8Answers: 0

    hi Colin,
    there u go.

  • colincolin Posts: 15,202Questions: 1Answers: 2,592

    Thanks - this might be related to this thread. We'll take a look and report back, probably tomorrow,

    Colin

  • Clark SClark S Posts: 27Questions: 8Answers: 0

    awesome, thanks.

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @Clark S ,

    I don't think this is going to have been resolved by the same issue Colin mentioned above. I've tried replicating the issue locally but am unable to do so. Please post a link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Thanks,
    Sandy

  • Clark SClark S Posts: 27Questions: 8Answers: 0

    Hi Sandy,

    I will spin up a test server today or tmw for this case, thnx for getting back to me.

  • Clark SClark S Posts: 27Questions: 8Answers: 0

    hi Sandy,


    http://104.129.128.180:8082/petrovend_transactions.html

    the server was directly generated by the official website.
    and if you select condition BETWEEN and set first date, immediately, in the console, I noticed errors showing:

    dependencies:

    node js server side:

    front end js:

  • Clark SClark S Posts: 27Questions: 8Answers: 0

    hi, any updates on this topic? thanks.

  • colincolin Posts: 15,202Questions: 1Answers: 2,592

    Sandy will be back in again on Thursday and will probably take a look then,

    Colin

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @Clark S ,

    I still can't replicate this locally I'm afraid.

    We've just noticed that you are storing the date as a VARCHAR which is probably where your error is coming from. You should store dates as a DATE for SearchBuilder to work with them properly. Try changing that and see if it works for you.

    Thanks,
    Sandy

  • Clark SClark S Posts: 27Questions: 8Answers: 0

    hi @sandy ,

    thnx for coming back to me.. yip we noticed the same thing and the err does go away when changing the data type from varchar to datetime however, we just need to do some cosmetic work to make our current sys adaptive to such change.. :)

    regards,

    Clark

Sign In or Register to comment.