• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

SQL Query Help

I have a column called rxbatch and the data is like mmddST(example-0926ST), which is the monthdateletterST.
It may also contain data like 'COST' 'FIRST'.
Now how to extract only those batches which are of the format mmddST.
The table is Hrxlabels and the column is rxbatch
Please advice.
1 Solution
Guy Hengel [angelIII / a3]Billing EngineerCommented:
this should be a starter:
WHERE rxbatch like '[0-1][0-9][0-2][0-9]ST'
Scott PletcherSenior DBACommented:
    rxbatch LIKE '[01][0-9][0123][0-9]ST%' --% is optional if additional char(s) never appear after the main pattern
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now