On Wed, May 11, 2011 at 12:55 PM, Richard Kaye <[email protected]> wrote: > Nice tip. I see Grigore says this will only work with SQL 2008 and later > though. > > I still think you have to cast invdate for an = comparison to return > something? Of course, we're working with a bunch of assumptions about what > invdate is in Rafael's example. ----------------
A heads up here. Adding a column that is int for the row in a DateTable will save your bacon. We do this in DW all the time. That DateTable will define: Date DOW DOY WOY Month Year Qtr Period WeekInPeriod and any other slice you think you need for comparison. Some people will join to this table for date values and others will do either an Exists () ow In () clause. Read up on In clause and how Not In () is flawed. Exists rocks in performance. -- Stephen Russell Unified Health Services 60 Germantown Court Suite 220 Cordova, TN 38018 Telephone: 888.510.2667 901.246-0159 cell _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

