I have a table-valued function which returns something like this:
Now, I have a date range as a parameter, let's say '2020-03-01' and '2020-04-15'
What I want is to also add a column that displays all the date from '2020-03-01' up to '2020-04-15'
It should look like this:
Overtime | Status | DTR | DATE_START | DATE
1. NULL | NULL | NULL | NULL | 2020-03-01
2. NULL | NULL | NULL | NULL | 2020-03-02
...
...
...
30. 6:32PM-9:32PM | Pending For Approval | NULL | 2020-03-30 | 2020-03-30
...
...
...
My code goes like this ,,Dont mind the 95476237 :
SELECT CAST(a.IndividualDate as date)
FROM DateRange('d', @start, @end) as a
LEFT JOIN support.dbo.overtimeReport('95476237', @start, @end) as b on CAST(a.IndividualDate as date) = CAST(b.DATE_START as date)
As a result, I only got this,
UPDATE: Small mistake, I forgot to mention the rest of columns in the SELECT statement. Thanks to @iamdave