Hi,
Please find below updated query (you can have last*executiontime or creation_*time):
SELECT
DB_Name(p.DatabaseID) AS DbName
,SUM(q.total_worker_time) AS CpuTimeInMiliSeconds
FROM
sys.dm_exec_query_stats q
CROSS APPLY
(
SELECT
CONVERT (INT, value) AS [DatabaseID]
FROM
sys.dm_exec_plan_attributes(q.plan_handle)
WHERE
attribute = N'dbid'
) as p
where convert(date,q.last_execution_time) between '02/28/2023' and '03/01/2023'
--where convert(date,q.creation_time) between '02/28/2023' and '03/01/2023'
GROUP BY
p.DatabaseID
order by
CPUTimeInMiliSeconds desc