June 9, 2016 at 12:36 pm
Lynn Pettis (6/9/2016)
Sean Lange (6/9/2016)
This still is not really very clear what you are trying to do but here is my shot in the dark. You are looking for rows where BOTH ColA AND ColB are between your 2 date parameters?The code for something like that would be:
WHERE ek.effdate between @StartD AND @EndD
AND ek.termdate between @StartD AND @EndD
Is that what you are looking for?
Looks like you found your answer. To bad you couldn't just have explained it that way to begin with, things would have been so much easier.
Congrats, Sean, on your shot in the dark. Looks like we know who had the crystal this time.
I dusted it off this morning in anticipation of needing today. The problem is that once you use the crystal ball it magically flies off to a random and unknown person. And most of the time they don't even know they have it until it gets used and disappears again. 😀
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing post 16 (of 15 total)
You must be logged in to reply to this topic. Login to reply