Sql help

I am working on a BAQ and could use some code help. Can anyone tell me how I would enter criteria against my table to select all records that have a dash as the 4th character, such as 123- or 234-?

Or…if I began with all records, that I could add a calculated field to return a text value of “Standard” if and when the fourth character is a dash.


FieldName LIKE ‘___-%’
Use the LIKE Operation and in the Constant value enter three underscores, your hypen and then a percent as a wildcard for the rest of the string:
In E10 most T-SQL is valid, here is a MS resource on this topic:

Hope that helps


Calculated Field. Something Like ttTable.Field.Substring(3, 1).Equals("_") return true else return false. Are you creating an emoticon query? :confused: :] :smiley: etc… I like it"

1 Like

Oooh, oooh, I want to play. Here’s a complicated way to do it:

Basically, test if there’s a “-” by using the numentries command and if so, return the length of the first entry. All 3’s will have a dash in the 4th position. Not nearly as efficient as the other solutions though unless your next step is to return the first segment.

Mark W.