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 2005 Forums
 Transact-SQL (2005)
 Query showing double rows

Author  Topic 

ravininave
Posting Yak Master

111 Posts

Posted - 2010-04-08 : 01:31:47
This is my query

CREATE PROCEDURE [dbo].[FetchComm]
(@FDate_1 [datetime],
@TDate_2 [datetime])

AS
BEGIN
Select MonComm.*,ePartners.PartName, ePartners.BankName, ePartners.BankAc, ePartners.BankBranch, ePartners.IFSCCode, ClientDets.ClientName as [Client] from MonComm Inner Join ePartners on MonComm.PartCode = ePartners.PartCode Inner Join ClientDets on MonComm.KarvyCode=MonComm.KarvyCode Where Date1 >= @FDate_1 AND Date2 <= @TDate_2
END


Actually I'm fetching data from Table for particular Date
but it is showing double entries of each row
like
Code no
1
1
2
2


VB6/ASP.NET
------------------------
http://www.nehasoftec.com

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-08 : 01:51:36
Then it can be that there are always 2 (or more) matches in the joined tables.
Have a look at your data. We cannot see.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

ravininave
Posting Yak Master

111 Posts

Posted - 2010-04-08 : 01:58:09
quote:
Originally posted by webfred

Then it can be that there are always 2 (or more) matches in the joined tables.
Have a look at your data. We cannot see.


No, you're never too old to Yak'n'Roll if you're too young to die.



No, not at all there is only 1 matching record in my table


VB6/ASP.NET
------------------------
http://www.nehasoftec.com
Go to Top of Page

ravininave
Posting Yak Master

111 Posts

Posted - 2010-04-08 : 02:07:24
Sorry, it was my mistake

insted of
ClientDets on MonComm.KarvyCode=MonComm.KarvyCode
I should write
ClientDets on MonComm.KarvyCode=ClientDets.KarvyCode

I Resolve it, thanx for ur reply
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-04-08 : 02:09:31
Ah good catch
I have not seen that.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -