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 |
|
shantanu88d
Starting Member
35 Posts |
Posted - 2011-03-22 : 01:29:29
|
| I have a variable which will have following valuesset @purchase_date = 'Jan 1 2011 12:00AM,Jan 2 2011 12:00AM,Jan 3 2011 12:00AM'I want to separate dates one by one...which function and how can I use it ???Please HELP ! |
|
|
stepson
Aged Yak Warrior
545 Posts |
Posted - 2011-03-22 : 02:53:42
|
| use charindex select substring(@purchase_date,1,charindex(',',@purchase_date,1)-1)set @purchase_date = substring(@purchase_date,charindex(',',@purchase_date,1)+1,len(@purchase_date)-charindex(',',@purchase_date,1)) select @purchase_dateput them in a while if are more dates |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-03-22 : 04:25:24
|
| Searcyh for Split function in this forumMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|