Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

how to fetch the first part of string from a whole lenghty string

$
0
0

Hi,


I have a data like - ex1:

  Auto Update : 10/04/2014 08:04  NEW data: xxxx OLD data: yyyy Ack - etr03 : 10/04/2014 08:13

 Auto Update : 10/04/2014 15:24  NEW data1 :xxx  OLD data1: yyyy Auto Update : 10/04/2014 09:36  NEW data1: xxx1 OLD data1: yyy1 Auto Update : 08/04/2014 12:28  NEW data1: xxx2 OLD data1: yyy2 Ack - jmi08 : 10/04/2014 09:53 Ack - WWI13 : 10/04/2014 15:32

I want to compare only NEW data: xxxx OLD data: yyyy or  NEW data1 :xxx  OLD data1: yyyy Auto Update : 10/04/2014 09:36  NEW data1: xxx1 OLD data1: yyy1 Auto Update : 08/04/2014 12:28  NEW data1: xxx2 OLD data1: yyy2with the same ste of value from another database but since I used substring I am getting even Ack - etr03 : 10/04/2014 08:13 value whose length changes for above 2 examples.

USed substring to get NEW data1 :xxx  OLD data1: yyyy Auto Update : 10/04/2014 09:36  NEW data1: xxx1 OLD data1: yyy1 Auto Update : 08/04/2014 12:28  NEW data1: xxx2 OLD data1: yyy2 

or

NEW data: xxxx OLD data: yyyy

but the ack part cannot be removed due to variable lenghts for each data hence could not compare this column between 2 databases. Any help would be highly appreciated.

Thanks,

Preetha


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>