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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to separate 1 column into 2 or more

Author  Topic 

sardinka
Posting Yak Master

142 Posts

Posted - 2006-12-20 : 09:25:22
I have the following result in my query:
PlanName1 :08/22/2006 - 11/01/2006; PlanName2:03/13/2006 - 08/21/2006;
How do I separate 1 column into 2 or more column?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-20 : 09:33:50

1 Why did you combine two dates in a single column?
2 You should normalise the data
3 Look for charindex in sql server help file
4 Search for split function here
5 If you use front end application, use split function there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-20 : 09:35:20
Rewrite your query to only include one valid result per row.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -