Hi VinothKumarAnnadurai-4871,
Please check:
Declare @startdate varchar(30)
Declare @enddate varchar(30)
SET @startdate = convert(varchar, getdate()-30,101)
SET @enddate = convert(varchar, getdate(),120)
SELECT
CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,
bkSet.database_name,
bkSet.backup_start_date,
bkSet.backup_finish_date,
bkSet.expiration_date,
CASE bkSet.type
WHEN 'D' THEN 'Database'
WHEN 'L' THEN 'Log'
END AS backup_type,
bkSet.backup_size,
MedFam.logical_device_name,
MedFam.physical_device_name,
bkSet.name AS backupset_name,
bkSet.description
FROM
msdb.dbo.backupmediafamily MedFam
INNER JOIN msdb.dbo.backupset bkSet ON MedFam.media_set_id = bkSet.media_set_id
WHERE
bkSet.backup_start_date BETWEEN @startdate AND @enddate
ORDER BY
bkSet.database_name,
bkSet.backup_finish_date
Best Regards,
Amelia
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.