SirPaladin
Programmer
For example, I need to use SQL to select records of only a particular area code. My current SQL statement (to find a specific phone number. I'm concatonating several search parameters so SQLString already contains the "SELECT * FROM [Companies] WHERE [other parameters]) looks like this:
SQLString$ = SQLString$ & " AND (([Companies].[MainPhone] = '" & Trim(Text1(12).Text) & "')"
I don't want to use just a simple "LIKE" clause that looks anywhere in the field because then l could end up with records that contain the number within it that are the same as the area code [ie. looking for area code "972" would grab 972-555-1212 as well as 214-534-9720]
So how do I specify that I only want to find records that match my search criteria in the first 3 characters of a field?
SQLString$ = SQLString$ & " AND (([Companies].[MainPhone] = '" & Trim(Text1(12).Text) & "')"
I don't want to use just a simple "LIKE" clause that looks anywhere in the field because then l could end up with records that contain the number within it that are the same as the area code [ie. looking for area code "972" would grab 972-555-1212 as well as 214-534-9720]
So how do I specify that I only want to find records that match my search criteria in the first 3 characters of a field?