Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Query

Author  Topic 

Verduveltje
Starting Member

4 Posts

Posted - 2012-05-03 : 11:14:53
Hi,

I have been struggling with this query all day, I simply cannot figure it out anymore.

I almost fixed it and now im getting stuff double or not getting it at all (the numbers are to high / to low) for calculated fields.

What do I think im doing wrong? Thinking way to difficult.

removed query


Anybody has an idea?

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2012-05-03 : 11:37:23
can you please provide sample data ad desired output..And also mention
what out are u getting ..By looking at your query we wont be able to
resolve it until we have proper info.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-03 : 15:08:07
best thing is to post output you're getting out of current query and explain what you mean by duplicates. Then by means of output explain what you're expecting to get out of it

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Verduveltje
Starting Member

4 Posts

Posted - 2012-05-04 : 03:31:50
Hi,

Thanks for the reply's.

This morning when I looked at it I just figured I could use a Union and that worked out just fine.
The problem was that I had a table (base table) from which I had to do 3 lookups on itself and i didnt get that right.

So solved by using a Union statement

Kind regards,

Verduveltje
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-04 : 19:07:14
cool

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -