1

Looking for a T-SQL query with regular expression to select records with today's date from sample data as below:

Sample data format:

[DAILY|MASTER|SUPER]-Integer-Date(yyyymmdd)

DAILY-60-20151216
DAILY-61-20151217
SUPER-62-20151218
DAILY-63-20151219
MASTER-64-20151220
DAILY-65-20151221
SUPER-66-20151222
DAILY-67-20151222

1 Answer 1

2

You don't need a regular expression for this, just the right() function:

where cast(right(data, 8) as date) = cast(getdate() as date)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.