I have a table that has two date fields (Date 1 and Date 3 in example below). I also have a Holiday table that lists all of the holidays. I would like to find an approach in a SQL query to be able to count the number of holidays between the two date values. Any ideas?
Example table:
Date 1 Date 2 5/1/2012 5/4/2012 8/31/2012 9/25/2012 12/23/2011 12/27/2011
Example of Date Dimension table:
Holiday Date 12/25/2011 1/1/2012 7/4/2012 9/3/2012
Ideal output:
Date 1 Date 2 Holidays 5/1/2012 5/4/2012 0 8/31/2012 9/25/2012 1 12/23/2011 1/10/2012 2