So real case scenario, I was asked to calculate real nights in a month. Below are the sample scenarios: If guest checked in at 2016-04-23, checked out at 2016-05-01, actual nights for May 2016 = 0 night If guest checked in at 2016-04-23, checked out at 2016-05-05, actual nights for May 2016 = 4 nights […]
Tag: sql
MS SQL How to find the latest restore info
So in my work I do automatically downloading and restore a database, however sometimes the automation doesn’t work properly perhaps due internet connection problem or space full, etc. In order to check that restore has been preformed successfully I just need to check if today is the last restore date. So here’s my query, using […]