本文介绍了如何从日期时间选择器值中获取小时和分钟的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我已经开发了一个桌面应用程序,其中我已经从访问数据库中获取数据,即与日期时间选择器值之间的小时和分钟的差异,为此,我在下面编写了代码,但我没有得到分钟数的差异.
Hi Everyone,
I have developed a desktop application in which i have fetch data from access database i.e difference of hours and minutes from datetime picker values, to get this i have written the code below but I am not getting the minutes difference.
mStrFinalQuery = "select VehicleMaster.RegistrationNo,VehicleTransaction.Barcode,VehicleMaster.VehicleType,VehicleMaster.VehicleModel,format(VehicleTransaction.TranInDate,""dd-MM-yyyy HH:mm:ss"") as InDate,format(VehicleTransaction.TranOutDate,""dd-MM-yyyy HH:mm:ss"") as OutDate,format(TranInDate,""HH"")-format(TranOutDate,""HH"") AS TotalOutHour,format(TranInDate,""mm"")-format(TranOutDate,""mm"") AS TotalMins from VehicleMaster inner join VehicleTransaction on VehicleMaster.Barcode = VehicleTransaction.Barcode where TranDate>= format('" & DateTimePicker1.Text & "',""dd-MM-yyyy"") and TranDate<= format('" & DateTimePicker2.Text & "',""dd-MM-yyyy"") order by TransactionId"
谢谢您的帮助.
Any help is kindly appreciated
推荐答案
这篇关于如何从日期时间选择器值中获取小时和分钟的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!