Wednesday, March 28, 2012

OK, Another Problem

Thanks for all the assistance with the time issue I was having. It looks like I can make the last code work somehow. I'll have to figure out how to incorporate it in, but I think I can probably manage that.

Here's my next question! I have a field in my source table that contains a range of values, separated by a dash. I need to parse this out into two separate destination table fields. The lengths before and after the dash will vary, so I need to be able to read up to the character, then from the other side of the character. Any suggestions on parsing? Books on line has not provided me with the answer (yet).

For example:

0.1-3.7 needs to be 0.1 (Field1) and 3.7 (Field2)
12.5-27
100-199

Thanks! This board has been extremely helpful for me (the pseudo-DBA).
Dirkcheckout CHARINDEX and PATINDEX either one of these should work for you.|||PATINDEX works perfectly for what I need.

Thanks again!
Dirk

No comments:

Post a Comment