You are here: Re: Getting Count(*) From Left side of Join using WHERE on right side of join « MsSQL Server « IT news, forums, messages
Re: Getting Count(*) From Left side of Join using WHERE on right side of join

Posted by Roy Harvey on 07/03/06 13:36

I think that COUNT(distinct tblStatements.fldStatementPK) will do what
you want. This assumes a single-column PK for the Statements table.

Roy Harvey
Beacon Falls, CT

On 3 Jul 2006 05:17:43 -0700, paulmac106@gmail.com wrote:

>Hi,
>
>I have 2 tables: tblStatements and tblLines (one to many) Any
>tblStatements record can have many associated records in tblLines.
>The search criteria is against tblLines (ie tblLines.fldDateofService
>>= '6/1/06' and tblLinesfldDateofService < '7/1/06'.) I join by tblStatements.fldStatementPK and
>tblLInes.fldStatmentID (one to many)
>
>I need to return a recordset that will look like (after i pass the
>date range)
>
>Total Statements Total Lines
>136 1,123
>24 869
>
>the problem i get when i join the two tables is that i get this:
>
>Total Statements Total Lines
>1,123 1,123
>869 869
>
>any help or direction would be greatly appreciated.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация