abenitez77
IS-IT--Management
I am querying a varchar field that has textual content with numberic information. I want to query for dollar ammounts in my database. Is this correct, or would you suggest I do it differently?
i.e.:
1,000
1000.00
$1000
$ 1000
1k
1m
Flat Dollars:
[MESSAGE] LIKE '%[0-9],[0-9][0-9][0-9]%'
OR [MESSAGE] LIKE '%[0-9][0-9][0-9][0-9].[0-9][0-9]%'
OR [MESSAGE] LIKE '%$[0-9][0-9][0-9][0-9]%'
OR [MESSAGE] LIKE '%$ [0-9][0-9][0-9][0-9]%'
OR [MESSAGE] LIKE '%[0-9]k%'
OR [MESSAGE] LIKE '%[0-9]m%'
In this example I want to query for anything that starts with CA or Credit Allowance.
CA words:
[MESSAGE] LIKE '%CA %'
OR [MESSAGE] LIKE '%CA#%'
OR [MESSAGE] LIKE '%CAS %'
OR [MESSAGE] LIKE '%CAS#%'
OR [MESSAGE] LIKE '%CREDIT ALLOW%'
OR [MESSAGE] LIKE '%CREDIT ALW%'
OR [MESSAGE] LIKE '%CREDIT ALLW%'
i.e.:
1,000
1000.00
$1000
$ 1000
1k
1m
Flat Dollars:
[MESSAGE] LIKE '%[0-9],[0-9][0-9][0-9]%'
OR [MESSAGE] LIKE '%[0-9][0-9][0-9][0-9].[0-9][0-9]%'
OR [MESSAGE] LIKE '%$[0-9][0-9][0-9][0-9]%'
OR [MESSAGE] LIKE '%$ [0-9][0-9][0-9][0-9]%'
OR [MESSAGE] LIKE '%[0-9]k%'
OR [MESSAGE] LIKE '%[0-9]m%'
In this example I want to query for anything that starts with CA or Credit Allowance.
CA words:
[MESSAGE] LIKE '%CA %'
OR [MESSAGE] LIKE '%CA#%'
OR [MESSAGE] LIKE '%CAS %'
OR [MESSAGE] LIKE '%CAS#%'
OR [MESSAGE] LIKE '%CREDIT ALLOW%'
OR [MESSAGE] LIKE '%CREDIT ALW%'
OR [MESSAGE] LIKE '%CREDIT ALLW%'