Only begin select if value is found in dataset sql
-
Hi I wish to only begin a select statement if the top value date is found. It's my way of knowing data has been added into a system at the beginning of the month e.g max date is 01/01/2018. If not take the last day of the month 31/10/2018. Table is called sales. Column is called SaleDateFrom. I want to pull e.g data from SaleDateFrom <=01/01/2018...if not pull data SaleDateFrom <=31/12/2018 Any ideas team?
-
Hi I wish to only begin a select statement if the top value date is found. It's my way of knowing data has been added into a system at the beginning of the month e.g max date is 01/01/2018. If not take the last day of the month 31/10/2018. Table is called sales. Column is called SaleDateFrom. I want to pull e.g data from SaleDateFrom <=01/01/2018...if not pull data SaleDateFrom <=31/12/2018 Any ideas team?
-
Hi I wish to only begin a select statement if the top value date is found. It's my way of knowing data has been added into a system at the beginning of the month e.g max date is 01/01/2018. If not take the last day of the month 31/10/2018. Table is called sales. Column is called SaleDateFrom. I want to pull e.g data from SaleDateFrom <=01/01/2018...if not pull data SaleDateFrom <=31/12/2018 Any ideas team?