SQL query returning incorrect results

I have this long SQL query that is returning an unusual result. It is duplicating one of the results even thoug it states that it is distinct. It works for the other scenarions but not for the one that ouputs as DEN:

DEP_ABB_NAME for the first record has four additional spaces at the beginning of it, or DEP_ID_NUM for that record has four additional spaces at the end of it, one of the two. Thus, they are distinct from each other.

I had also thought that there was a difference in the data, but that's not it. I did a lenght of the fields and the two repeated lines are exactly the same, which is why this is so troubling. It looks like it has more spaces because of the way it pasted here, but they don't.

Karla

0

kkoehlerAuthor Commented: 2007-10-13

I finally figured it out, there was a condition missing from the main select statement: and c.cov_cvrg_beg_dat_intl >= '2008-01-01' as soon as i added it worked, yeahhhhh!!!

Featured Post

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.