How to get SQL statement from Radfilter

4 posts, 0 answers
  1. piet
    piet avatar
    4 posts
    Member since:
    Sep 2012

    Posted 24 Nov 2011 Link to this post


    When using the  RadFilterSqlQueryProvider and using a datetime field in the Radfilter the result of the provider.Result call is for example:

    ([date)] >= '23-11-2011 16:00:00')

    For SQL however one expects:
    ([date)] >= CONVERT(DATETIME, '2011-11-23 16:00:00', 102))

    The other providers of the Radfilter also don't give a result that could be used in a where clause of an SQL statement. Do you have a solution to this?
    One would expect that a custom sqlprovider (with base class RadFilterSqlQueryProvider) would be available for e.g. ms-sql and mysql.


  2. Mira
    Mira avatar
    1124 posts

    Posted 29 Nov 2011 Link to this post

    Hello Piet,

    You are indeed right - the current the providers do not contain one that is suitable for MySql queries. I have forwarded you request to our developers and they will consider implementing it.
    Currently, you can use a Regex for finding the dates and replacing them with their value in the correct format.

    I hope this helps.

    Best wishes,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Michael Best
    Michael Best avatar
    1 posts
    Member since:
    Apr 2004

    Posted 16 Mar 2018 in reply to Mira Link to this post

    Something new about formatting dates in RadFilterSqlQueryProvider?

  4. Eyup
    Eyup avatar
    4018 posts

    Posted 21 Mar 2018 Link to this post

    Hello Michael,

    The SQL WHERE statement should be able to work without CONVERT:

    Could you clarify what exactly you want to achieve?

    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top