Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with Query - How to limit/create result group
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01201189
Message ID:
01201200
Vues:
35
See, if you can work out the idea from http://www.tek-tips.com/viewthread.cfm?qid=1052688

>Naomi
>
>Thanks, wrong cut & paste. Here is the correct query:
>
>
>select det.DateValue,
>	det.RoomID,
>	det.SchedItemID,
>	det.TimeValue,
>	det.SlotOpen,
>	dateadd(mi,det.TimeValue,NormalizedDate) as NormalDateTime
>from
>(
>SELECT  dbo.DateRoom.DateValue,
>	dbo.DateRoom.RoomID,
>	dbo.SchedItem.SchedItemID,
>	dbo.SchedItem.TimeValue,
>	dbo.SchedItem.Meetingnumber,
>        dbo.SchedItem.SlotOpen,
>	dbo.SchedItem.ResourceType, dbo.SchedItem.ResourceID,
>	dateadd(dd,DateValue,'01/01/1900') as NormalizedDate
>FROM    dbo.DateRoom INNER JOIN
>        dbo.SchedItem ON dbo.DateRoom.dateRoomID = dbo.SchedItem.DateRoomID
>where  DateValue = @nStartDate
>and RoomID IN (
>	SELECT distinct dbo.corooms.roomid
>	FROM   dbo.coproc INNER JOIN
>	       dbo.coProcRoomGrp ON dbo.coproc.procid = dbo.coProcRoomGrp.procID INNER JOIN
>	       dbo.coRoomToGroup ON dbo.coProcRoomGrp.coRoomGrpID = dbo.coRoomToGroup.coRoomGrpID INNER JOIN
>	       dbo.corooms ON dbo.coRoomToGroup.RoomID = dbo.corooms.roomid inner Join
>	       dbo.coProcStartTimes on coProc.ProcID=coProcStartTimes.ProcID
>	WHERE  dbo.coproc.procid = @tiProcID and dbo.coRooms.Isactive=1)) det
>where TimeValue >= 360
>order by SchedItemID
>
>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform