Calculate days-hours-minutes

Source: Internet
Author: User

SELECT
 a.consume_code consumecode,
 s.trans_code transcode,
 t.company_name Companynname,
 a.wlb_code wlbcode,
 a.user_name userName,
 a.consignee consignee,
 a.cons_city conscity,
 floor (
  hour (
   timediff (now (), A.order_ Date)
  )/ex_order_day
 ),
 mod (
  hour (
    Timediff (now (), a.order_date)
  ),
  24
 ) Ex_order_hour,
 minute (
  timediff (now (), a.order_date)
 ) Ex_order_minute,
 a.order_date orderDate
from
 rs_sale_order_base a
left join Rs_sale_order_service s on a.consume_code = S.consume_code
Left join Ru_ Company_trans T on s.main_company_code = T.company_code
WHERE
 1 = 1
and A.consume_code not in (
 s Elect
  h.consume_code
 from
  hf_info h
)

This article is from the "Yang Hailong blog" blog, make sure to keep this source http://7218743.blog.51cto.com/7208743/1643552

Calculate days-hours-minutes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.