SQL functions "ROUND" cannot be called in Editor.NET

SQL functions "ROUND" cannot be called in Editor.NET

szxszx Posts: 11Questions: 4Answers: 0
edited February 2018 in Editor

I'm using Editor on asp.net api.
In a Editor instance set a new field like,

new Field("ROUND(1.33333, 2)", "Amount")

But the api returned "Amount":null in json.
Could you help me how to fix it?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Hi,

    Thanks for flagging this up - it looks like a bug in the Editor .NET libraries. In the Query.cs file is:

    if (addAlias && field != "*" && field.IndexOf("(") == -1)
    

    that last condition is a legacy check and should be removed. Using just:

    if (addAlias && field != "*")
    

    allows it to work with SQL Server.

    That change will be in Editor 1.7.3.

    Regards,
    Allan

This discussion has been closed.