How To Calculate Date

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View How To Calculate Date as PDF for free.

More details

  • Words: 101
  • Pages: 1
description: if the week ending day is saturday, how do you calculate the following saturday based on the current date. for example, if today is 9/29/05, how would you calculate that next saturday is 10/01/2005. solution: add this calculation to the report. this will calculate the date until the end of saturday, which is 11:59:59 pm. case when _day_of_week ( current_date ,1)=1 then _add_days(current_date,6-(1/24/60/60)) when _day_of_week ( current_date ,1)=2 then _add_days(current_date,5-(1/24/60/60)) when _day_of_week ( current_date ,1)=3 then _add_days(current_date,4-(1/24/60/60)) when _day_of_week ( current_date ,1)=4 then _add_days(current_date,3-(1/24/60/60)) when _day_of_week ( current_date ,1)=5 then _add_days(current_date,2-(1/24/60/60)) when _day_of_week ( current_date ,1)=6 then _add_days(current_date,1-(1/24/60/60)) else _add_days(current_date,7)

Related Documents