Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I am using the following substring logic within my query. expecting just 4 digit year values, but there are lot of rows within the table has charecter based values like BKUP seems like bakup. now i want to exclude anything that has other than year value after sub string. Is it possible in the where condition.substring(DATA_SET,7,10) YEAR,
Unless you are using dates far in the past or future, you can restrict the date check somewhat more:...WHERE substring(DATA_SET, 7, 10) LIKE '[12][0-9][0-9][0-9]'