Thanks both for the valuable info, but I'm still having issues.
I've changed my syntax to:
where documentname like '%[_]US[_]%[_]%[_]%.pdf'
But curiously, this doesn't pick up document names such as '5_US_KR_08_12.pdf' (the single quotes are actually part of the string)
But when I pare it...
How can I search for literal wildcard characters in a string? For example, SQL interprets an underscore as any single character, but I need to find an actual underscore character.
I need to find strings matching this format, where ONLY the % sign is a wildcard:
%_US_ %_%_%.pdf
Thanks!
Thanks PHV! That ended up being why EOF was still true; ADODB interpreted * as part of the string, and so it found no records, but the query editor interpreted it as a wilcard, so it did. I changed the character from * to % in code and that solved it. Thanks again. :)
batch_key is a string: nvarchar(100). (I know earlier I said it's not an ADP file, but I do connect with a sql db via odbc, in addition to local Access tables.)
I should add that, before I realized I needed to use the 'Like' with the wildcard and was still running sql without it, the command object and recordset were returning data just fine and I haven't changed them since. I'm looking things over again.
Thanks to all of your help, it looks like I've got the right syntax now, but I'm not quite out of the woods. This is what it resolves to in the immediate window:
SELECT * from qryDF24 where child_key like '*GC8871*' and batch_key = '218521';
Here's the catch (which leaves me befuddled...)...
I'm afraid I've tried all of these with no luck. I had kept things simple at first just to give an example of what I'm trying to do, but now I've included my full code below. Basically, the code is designed to go through a form, reading each child_key and its corresponding batch_key field and...
I need to dynamically build a select statement in code that concatenates a string parameter variable. I'm having issues getting the quotes and wildcards placed correctly. For example, I need to build a select statement such as
Select * from QueryName where CodeField like "*SC12345*"
I have...
I have a string of alpha-numeric codes separated by commas and need to count how many commas are in the string to determine how many codes are listed (one more than the number of commas).
I know instr() will return the first instance of a character, but how can I count how many of them?
For...
I have a table that tracks donations made by people to a variety of different funds. Information tracked includes a donor id, the fund id for what they donated to, the date of the donation, etc. Every day various mailings (using different templates for each fund) are sent out for all donations...
My sproc (below) is supposed to load the data from a table that is passed to it into a table called tblPrintLog. It does not err out, but it does not load any data either. It just shows "(0 row(s) affected)". In the test table I'm using, there are 108 rows. What am I doing wrong? As an...
This is good information, but I'm running this in a project, so I can't run a query like this because it tries to run it against sql server. What would be the code equivalent? Thanks!
I need to automatically load the contents of a number of tables into a single table. I'd like to set up a loop that iterates through a list of all the table names, tests each name to see if it follows a certain naming convention, and if it does, append the contents into another table. I can do...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.