use Leo
go

alter function dbo.tvf_BudgetInPeriod (
  @str_dt date = null
  , @end_dt date = null
) returns table
as return
  select Id, TrxDate, TrxDate_ISO8601, TrxDescription, TrxAmount, RunningBal
  from dbo.vw_BudgetRunningBalance
  where TrxDate between isnull(@str_dt, dateadd(day, 1, eomonth(getDate(), -1))) and isnull(@end_dt, eomonth(getdate()))
go
