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 |
lew26
Starting Member
5 Posts |
Posted - 2007-11-06 : 22:22:29
|
I have select statement i need help with (see below). basically i am trying to figure out how i can make this work with the way the backend is designed. The backend basically is using a asp table control, all the code is written so modification to this query would require extension re-writes on the back end.I need to be able to select Distinct row based on the [When] column which is a datetime column, "2007-11-24 16:00:00.000" for some reason it select row duplicate rows. For instance when i run this query current it output 4 rows, i only need two of those rows the other are duplicate rows, which contain the same values in each of the fields as the other two.The problem also if the stage based on the stageid will always have the same stage name-- Select QuerySELECT Stage, [When], [Band], Length, Promo, Location, When2, setkey, EntMedia, SetsMedia, Location_Website, Pic12, Stage_Website, BandID, StageIDFROM PromoScheduleWHERE (See_In_Promo = 1 and Hide_From_Promos = 0) AND ([When] between '11/24/2007 06:00 AM' And '12/08/2007 06:00 AM') AND (WhereID = 90) AND (WhereID <> 8)Order by Location, Stage, [When]DigitalSolversYahoo: DigitalSolversMSN Live: lew26@msn.comSkype: DigitalSolvers |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-11-06 : 22:29:46
|
tried using distinct ?also this is redundant as you already have a WhereID = 90" AND (WhereID <> 8) " KH[spoiler]Time is always against us[/spoiler] |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
Reporter
Starting Member
48 Posts |
Posted - 2007-11-07 : 03:29:55
|
I don't understand what do you need. Do you need to obtain distinct rows set based on the [When] or distinct rows which contain the same values in each of the fields or something else? |
 |
|
|
|
|
|
|