Yes I admit I'm doing it a step at a time, I will make it smoother later.
getting the date values seems to work OK, I can see this by stepping through the code both start and end date are correct, the problem is the WHERE statement, it doesn't work when I AND both together but works OK if I use...