Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

Trying to compare parts of a single string in change log record to exclude zip +4 changes

$
0
0
I have a change log record that records address changes. Many of these changes are the result of address standardization. I'd like to exclude records that are only zip + 4 changes.This is the pattern of the text:Name.FULL_ADDRESS: street address city, ST zip + 4 -> street address city, ST zip The zip + 4 includes the dash, the zip would only have 5 digits.I'm guessing my string comparison needs to compare everything after Name.FULL_ADDRESS: up to '->' to everything after '->' where the last 10 characters don't include '-' ?This is my script to extract multiple changes for the past month. SELECT ID, COUNT(ID) AS CountofChanges, LOG_TEXTFROM NameLogWHERE (LOG_TEXT LIKE 'Name.FULL_ADDRESS:%') AND (DATE_TIME >= DATEADD(month, - 1, GETDATE())) GROUP BY ID, LOG_TEXTHAVING (COUNT(ID) > 1)Can anyone push me in the right direction?

Viewing all articles
Browse latest Browse all 6525

Trending Articles