Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using "partition"

Status
Not open for further replies.

sbbrown9924

Technical User
Mar 7, 2003
80
US
Hello;

About 6 months ago I had asked for assistance to help count the number of patients seen in an ER by hour. The query was:

SELECT Partition(DateDiff('n',TriageTime, InRoomTime)/60, 0, 10, 1) AS [WaitingTimeRange], Count(*) As [Patients] FROM Archive WHERE (TriageTime > #DateBegin#) AND InRoomTime<>#1/1/1900# GROUP BY Partition (DateDiff('n',TriageTime, InRoomTime)/60, 0, 10, 1)

Someone (sorry, I lost the link) had given me a link to a MSDN tech page explaining the partition function. Can anyone point me to that page again? I am trying to format the output. Right now its

0:0 7
1:1 14
2:2 456
3:3 43
etc.....


I'd like for it to

0:1 7
1:2 14
2:3 456
3:4 43
etc...

so the hourly intervals make more sense. So 0:1 is "from 0 to one hour, 1:2 is "from 1 to 2 hours", etc...

Thanks.


 
have you tried ye olde standby 'H E L P' (aka {F1}? I recall a reasonable explination rith in your back yard / disc.




MichaelRed


 
Golum;

Yes! Thanks Golum - I could not find that page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top