I got this code from developer 1, my question does this code for creating the master calendar is valid for all document or there is some change I have to do. . coz I applied for my own document, but it does'not accept. .
And if any modification, please tell me in which place. . See my document is having been same like that one but maybe year is different please.
The point of the temporary table is to get a list of all possible dates between the earliest and latest dates in your data. This will allow you to plot a line graph over time with the time axis being correct (rather than being skewed by missing values).
If you do not require the missing dates to have the various permutations worked out for you can just do the various functions directly to the OrderDate field in the Orders table.
If you are only wanting dates within a specified range then replace the two peek statements (which are getting max and min) with hard coded date values.