如何在水晶报表的公式字段中写入这些数据值

时间:2016-12-27 15:33:32

标签: crystal-reports

我有一个SQL语句,但我不能在报告中使用它(因为它不断崩溃CRXI)所以我怎么能在公式字段中写这个?

      <% @posts.each do |post| %>
        <!-- Shot -->
        <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3">
          <div class="shot shot-minimal">
            <div class="shot-preview">
              <a class="img" href="shot-gallery.html"><img src="http://rwdtow.stdout.in/img/avatar-icon.png" alt=""></a>

              <%= link_to post, class:"text-overlay" do %>        
               <span class="heading"><%= post.tite %></span>
               <span class="desc"><%= post.shortdescription %></span>
               <time datetime="2016-02-04 22:30">7 hours ago</time>
              <% end %>
            </div>

            <div class="shot-detail">
              <div class="shot-info">
                <p><%= post.title %></p>
              </div>

              <ul class="shot-stats">
                <li><i class="fa fa-eye"></i><span>6.3k</span></li>
                <li><a class="like" href="#"><i class="fa fa-heart"></i><span>1.2k</span></a></li>
              </ul>
            </div>
          </div>
        </div>
        <!-- END Shot -->
      <% end %>

如果记录满足这些值((ACTUAL_DELIVERY - 15 MINUTES < T.DELIVER_BY_END AND TIME(T.DELIVER_BY_END) <> '00:00:00') OR (ACTUAL_DELIVERY - 15 MINUTES <= T.DELIVER_BY_END + 1 DAY))

1 个答案:

答案 0 :(得分:0)

IF ({TLORDER.DELIVER_BY_END} - {TLORDER.ACTUAL_DELIVERY} >= -.0104 AND 
{TLORDER.DELIVER_BY_END} <> DATETIME(YEAR({TLORDER.DELIVER_BY_END}), MONTH({TLORDER.DELIVER_BY_END}), DAY({TLORDER.DELIVER_BY_END}), 00,00,00)) 
OR 
({TLORDER.DELIVER_BY_END} - {TLORDER.ACTUAL_DELIVERY} >= -1.0104 AND 
{TLORDER.DELIVER_BY_END} = DATETIME(YEAR({TLORDER.DELIVER_BY_END}), MONTH({TLORDER.DELIVER_BY_END}), DAY({TLORDER.DELIVER_BY_END}), 00,00,00))
THEN 1 ELSE 0