• s gupta (3/13/2008)


    Thanks for the reply gsquared.

    The number of rows returned are correct... but somehow the count is messed up. I am trying to figure out why. The total number of users matching the date range is not the same as the total of all users returned by city/group.

    Let me first try to understand what does cross join do?

    Try running the sub-query (the derived table) without the outer query, and see if the data from it makes sense.

    I also realized that, in my query, I used "<" where you had "<=". That might make a difference.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon