Hi!
I am trying to extract data from a Problem DB in SQL. The Problems in the database pass through different states as they are treated. The states are named and there is an associated time stamp for each state. In my query I want to SELECT the Problem id and then the time stamp for 3 different states, i.e. I want there to be only one resulting record for each problem id and the associated time stamps in 3 separate columns.
I can't figure out how to write an SQL statement to acheive this (maybe it is not even possible). I made some attempts in Crystal SQL Designer, which allowed me to put together a query string (it had a 3 SELECT statement inside the main SELECT statement) but when the query was run I get ODBC SQL Server Driver Error saying error close to the 2nd(?) SELECT statement.
Maybe I am complicating things, but is there anyone who could lead me on the right path it would be appreciated!!
Regards
Anders
I am trying to extract data from a Problem DB in SQL. The Problems in the database pass through different states as they are treated. The states are named and there is an associated time stamp for each state. In my query I want to SELECT the Problem id and then the time stamp for 3 different states, i.e. I want there to be only one resulting record for each problem id and the associated time stamps in 3 separate columns.
I can't figure out how to write an SQL statement to acheive this (maybe it is not even possible). I made some attempts in Crystal SQL Designer, which allowed me to put together a query string (it had a 3 SELECT statement inside the main SELECT statement) but when the query was run I get ODBC SQL Server Driver Error saying error close to the 2nd(?) SELECT statement.
Maybe I am complicating things, but is there anyone who could lead me on the right path it would be appreciated!!
Regards
Anders