Hi all,
I have two fields in a query: [Paragraph List] and [Specific Paragraph]. [Paragraph List] is a list of comma-separated paragraph numbers (like 1.0, 1.1, 1.1.2, etc); [Specific Paragraph] is just "1.0" or "1.1.2" or the like. I wanted to create a third field called [Paragraph Check] that would scan through [Paragraph List] to find where it equals [Specific Paragraph]. I tried this:
Paragraph Check: InStr([Paragraph List],[Specific Paragraph])
This was useful because if [Specific Paragraph] didn't show up in [Paragraph List] it gave me gave the value "0"; otherwise, it gave me the position of the [Specific Paragraph] (6 or 20 or 29), which didn't matter because if it's >0 the check works.
HOWEVER, if [Paragraph List] contains 3.2.2.1, and [Specific Paragraph]'s value is 3.2, I get a result <>0 because, technically, 3.2 is found within 3.2.2.1 (which is bad).
Is there a SQL to get this to be an exact match?
I have two fields in a query: [Paragraph List] and [Specific Paragraph]. [Paragraph List] is a list of comma-separated paragraph numbers (like 1.0, 1.1, 1.1.2, etc); [Specific Paragraph] is just "1.0" or "1.1.2" or the like. I wanted to create a third field called [Paragraph Check] that would scan through [Paragraph List] to find where it equals [Specific Paragraph]. I tried this:
Paragraph Check: InStr([Paragraph List],[Specific Paragraph])
This was useful because if [Specific Paragraph] didn't show up in [Paragraph List] it gave me gave the value "0"; otherwise, it gave me the position of the [Specific Paragraph] (6 or 20 or 29), which didn't matter because if it's >0 the check works.
HOWEVER, if [Paragraph List] contains 3.2.2.1, and [Specific Paragraph]'s value is 3.2, I get a result <>0 because, technically, 3.2 is found within 3.2.2.1 (which is bad).
Is there a SQL to get this to be an exact match?
Comment