Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. SQLJoe

    Looking for wildcard characters as literal strings

    Oops, I should have caught that. Wasn't paying attention. Thanks!
  2. SQLJoe

    Looking for wildcard characters as literal strings

    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...
  3. SQLJoe

    Looking for wildcard characters as literal strings

    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!
  4. SQLJoe

    Concatenating a variable into dynamic SQL

    Thanks AceMan, that's a great technique!
  5. SQLJoe

    Concatenating a variable into dynamic SQL

    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. :)
  6. SQLJoe

    Concatenating a variable into dynamic SQL

    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.)
  7. SQLJoe

    Concatenating a variable into dynamic SQL

    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.
  8. SQLJoe

    Concatenating a variable into dynamic SQL

    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...)...
  9. SQLJoe

    Concatenating a variable into dynamic SQL

    Thanks PWise, but unfortunately it's not an ADP file. Otherwise my life would be much easier! :)
  10. SQLJoe

    Concatenating a variable into dynamic SQL

    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...
  11. SQLJoe

    Concatenating a variable into dynamic SQL

    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...
  12. SQLJoe

    Counting Commas in a String

    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...
  13. SQLJoe

    Selecting the Penultimate Record

    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...
  14. SQLJoe

    Sproc Loads No Data, But No Error Either?

    Got it! Very helpful. Thanks both!
  15. SQLJoe

    Sproc Loads No Data, But No Error Either?

    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...
  16. SQLJoe

    Looping Through All Table Names in a DB

    Oops, please isregard my former comment. With all your help, I got it now. Thanks!
  17. SQLJoe

    Looping Through All Table Names in a DB

    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!
  18. SQLJoe

    Looping Through All Table Names in a DB

    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...
  19. SQLJoe

    Selecting one row for each id

    Works great, thanks!

Part and Inventory Search

Back
Top