Filter. checking the value in a variable

Hey!
Please advise
Is it possible to add a check for the presence of a value in a variable?
I wanted to add a check for the value of the variable and if it is missing put down the current date

SELECT COALESCE([[{{variable_name}}]],GETUTCDATE())

get an error "Incorrect syntax near ','."

Put the comma before the first closing ]
Like this:

SELECT COALESCE([[{{variable_name}},]]GETUTCDATE())

Whatever is between the brackets is only set if the variable has a value. Your query was returning a comma even if there was no value in the variable.