select t1.InvoiceNumber ,t1.LocalAmount , t2.LineAmount as discount , t1.CreateDate
from CashOrderTrn t1
left join DistrubutedDiscountDetails t2
on t1.InvoiceNumber = t2.InvoiceNumber
and t1.CreateDate between '20160531' and '20160701'
and t1.InvoiceType ='31'
Run Code Online (Sandbox Code Playgroud) 我希望将日期 (22/03/2016 23:59:59) 格式化为以毫秒为单位的字符串。
dr.GetDateTime(1).ToString("yyyy-MM-dd hh:mm:ss")
.ToString("yyyy-MM-dd").ToString("hh':'mm':'ss")