I’d like some help editing the current date. I need getdate -1 day, but the entry must look like DDMMYYYY.
RIGHT( “00”+ (DT_WSTR, 2) (DAY(GETDATE())-1),2)+RIGHT( “00”+ (DT_WSTR, 2)
MONTH(GETDATE()),2)+(DT_WSTR, 4) YEAR(GETDATE())
Unfortunately, the first day of the month gives the wrong date.
Today is 01/07/2024 and I need the date 30/06/2024(30062024)
Thank you all,
John
RIGHT( “00”+ (DT_WSTR, 2) (DAY(GETDATE())-1),2)+RIGHT( “00”+ (DT_WSTR, 2)
MONTH(GETDATE()),2)+(DT_WSTR, 4) YEAR(GETDATE())
Jan Dvořák is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.