Trying to be simple with info.\
1) I have fields in a table for bill schedules like the following
bl_start_date_24 bl_stop_date24 bl_start_date_23 bl stop_date_23 bl_start_date_22 bl_stop_date_22 etc
09-01-2023 09-01-2023 08-01-2023 08-31-2023 07-01-2023 07-31-2023
I want to be able to code something in Alteryx sql code to be similar to below but this is just logic I would like it to work.
declare bill_start_date Date value
BL_START_DATE =
IF BL_START_DATE24 < todays_date THEN BL_START_DATE24 ELSE
IF BL_START_DATE23 < todays_date THEN BL_START_DATE23 ELSE
IF BL_START_DATE23 < todays_date THEN BL_START_DATE23 ELSE
Continue thru #1
BL_STOP_DATE/A8YYMD =
IF BL_STOP_DATE24 > todays_date THEN BL_STOP_DATE24 ELSE
IF BL_STOP_DATE23 > todays_date THEN BL_STOP_DATE23 ELSE
IF BL_STOP_DATE23 > todays_date THEN BL_STOP_DATE23 ELSE
Continue thru #1
end
--the above will give me the current bill schedule dates (both start and stop in the above variables. Now I want to print.
select
acccount_number
bl_start_date
bl_stop_date
from
limit 10
_____
Can you help me to do this?