This is a migrated thread and some comments may be shown as answers.

How to get SQL statement from Radfilter

3 Answers 120 Views
Filter
This is a migrated thread and some comments may be shown as answers.
piet
Top achievements
Rank 1
piet asked on 24 Nov 2011, 09:42 PM
Hello

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.

Thanks
Piet

3 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 29 Nov 2011, 08:39 AM
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,
Mira
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
0
Michael Best
Top achievements
Rank 1
answered on 16 Mar 2018, 05:39 PM

Something new about formatting dates in RadFilterSqlQueryProvider?
thanks

0
Eyup
Telerik team
answered on 21 Mar 2018, 02:34 PM
Hello Michael,

The SQL WHERE statement should be able to work without CONVERT:
https://stackoverflow.com/questions/6584666/whats-wrong-with-this-less-than-date-query

Could you clarify what exactly you want to achieve?

Regards,
Eyup
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.
Tags
Filter
Asked by
piet
Top achievements
Rank 1
Answers by
Mira
Telerik team
Michael Best
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or