Skip to content
Advertisement

Given day, month and year, calculate weekending date

Given day, month and year as integer columns in the table, calculate the date and weekending date from these values.

I tried the following but it gives me an incorrect result for the derived date as ‘2022-08-05 00:00:00’

Even tried below but results in a string without leading zeros for month and day

Result for above is : 202032

Advertisement

Answer

The problem is that you have numbers — so leading zeros are missing. You can try:

Or, if these have to be numbers:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement