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.
Author |
Topic |
krishna.kanigelpula
Starting Member
5 Posts |
Posted - 2011-07-16 : 04:04:17
|
Hi Team,I have the following columns in my database in one table.A patinet can change multiple centers. The following is a sample of a patient dataPno EnterDate Exitdate Centerabc 01/01/2010 01/02/2010 Sydneyabc 02/02/2010 25/03/2010 NYabc 26/03/2010 09/06/2010 California I want count of all patients in the centre "NY" on 20/01/2010 date.Please advise the SQl to get that information.ThanksKrishna. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-07-16 : 04:22:52
|
[code]select count(*)from onetablewhere Center = 'NY'and EnterDate <= '2010-01-20'and ExitDate >= '2010-01-20'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
krishna.kanigelpula
Starting Member
5 Posts |
Posted - 2011-07-16 : 21:14:48
|
Thanks for your reply. |
 |
|
|
|
|