searching datetimes in yyyy-mm-dd and time format using server side processing not working...

searching datetimes in yyyy-mm-dd and time format using server side processing not working...

lvsundlvsund Posts: 7Questions: 2Answers: 0

Hi, i am coming across some 'funky' behaviour when using jquery tables search box in server side processing mode when it comes to dates. In client side processing i can use the yyyy-mm-dd string in search box and it filters correctly on that date requested. But when i go to server side processing, it doesn't filter correctly. If I put in the yyyy format it works. But if I put in anything after that like yyyy- or yyyy-mm formats etc it finds no records. It seems not to like the hyphen.

The filter uses in my c# code contains:

p.DateTimeSubmitted != null && p.DateTimeSubmitted.ToString().ToLower().Contains(search.ToLower())

In other words I make sure the date is converted to string and then lower case and compare the searchstring lowercase.

What would cause this? No error messages at all- just doesnt come up with any records once anything beyond the year yyyy is put in the search box.

AS mentioned - client processing works fine...

Answers

  • allanallan Posts: 61,933Questions: 1Answers: 10,154 Site admin

    With server-side processing enabled, it means that the search is being done by your C# program, so we've narrowed it down to that at least.

    What I would suggest is that you log or otherwise print out the SQL statement that your code is generating (I'm assuming you are using SQL?). It sounds like either there is a type conversation error, or an SQL error - although in both cases I'd expect an error to be triggered.

    Allan

This discussion has been closed.