的信息:
- 早上时间表格上午7:00至下午7:00
- 夜间时间从晚上7:00到上午7:00
样本数据:
- 入住时间:29-1-2014 7:00 PM退房30-1-2014 3:00 AM解决方案:早上0小时 - 晚上8小时
- 入住时间:29-1-2014 7:00 PM退房30-1-2014 10:00 AM解决方案:早上3小时 - 晚上12小时
- 入住时间:29-1-2014 5:00 PM退房时间29-1-2014 11:00 PM解决方案:早上0小时 - 晚上7小时
- 入住时间:29-1-2014 6:00 AM退房时间29-1-2014 9:00 PM解决方案:早上12小时 - 晚上4小时
问题:
我需要使用sql server函数在CheckIn Datetime和CheckOut Datetime之间获得早晨时间和夜晚。