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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-05-03 : 13:06:32
|
TomArgh writes "Hi,I am trying to query the same field in a table multiple times, each time returning the field AS [a new name] with each instance of the field matching a different WHERE criteria for the time field.I have a table collecting data on an hourly basis, I want to construct a query that returns the data broken down into hours over the day, as shown below.Table...ID DataSource Time Value1 Source1 12:00 152 Source1 13:00 103 Source2 13:00 114 Source1 14:00 125 Source2 14:00 9 SQL output required....DataSource hour12 hour13 hour14 hour15 ..etcSource1 15 10 12Source2 11 9 Thanks for your thoughts...(SQL server 7)" |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2004-05-03 : 13:35:00
|
| Do a search on Dynamic Crosstab on the main site. That's what you are looking for. Enjoy!Michael<Yoda>Use the Search page you must. Find the answer you will.</Yoda> |
 |
|
|
|
|
|