【问题标题】:Odata url conversion of date using between日期的 Odata url 转换使用 between
【发布时间】:2014-06-06 07:25:13
【问题描述】:

我有这样的查询

 select * 
from xxx 
where dates between '2012-10-26' and '2012-10-27'

如何将其转换为 Odata 服务中的 URL

【问题讨论】:

  • 我解决了这个问题

标签: c# java android odata odata4j


【解决方案1】:

我解决了这个查询转换为这样的 URL

$format=json&$filter=year(LastModifiedDate)+ge+2012+and+month(LastModifiedDate)+ge+09+and+day(LastModifiedDate)+ge+25+and+hour(LastModifiedDate)+ge+00+and+minute(LastModifiedDate)+ge+00+and+second(LastModifiedDate)+ge+00+and+year(LastModifiedDate)+le+2012+and+month(LastModifiedDate)+le+12+and+day(LastModifiedDate)+le+31+and+hour(LastModifiedDate)+le+23+and+minute(LastModifiedDate)+le+59+and+second(LastModifiedDate)+le+59

【讨论】:

    【解决方案2】:

    可以这样查询: http://service/odata/Products?$filter=dates gt datetime'2012-10-26' and dates lt datetime'2012-10-27'

    【讨论】:

    • URL 中的时间不能正常工作。我怎样才能用时间编写 URL
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-01-06
    • 2013-09-24
    • 2011-01-23
    • 2013-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多