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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Wildcards In MSSQL 7

Status
Not open for further replies.

sleepyd

IS-IT--Management
Jul 1, 2003
3
US
Hello. I have a column called "Report Path" in a table that lists a path to a file on our network that then pulls to our website. The path will always be the same for all recordsets, the filename however will point to a pdf that will vary with each account. For example, here is what you would find under this column for a recordset:

REPORT/^PDF/accountABC.pdf

The problem is this, each quarter the program we use to compile these reports appends a series of numbers at the end of the filename to represent the date. Like this:

REPORT/^PDF/accountABC20030331.pdf

Since the filename should never change, I need to use a wildcard to account for the date numbers that will get added each quarter. I have tried something like this:

REPORT/^PDF/accountABC*.pdf and the same, but with a "%" instead of a "*". Both cases I get a file not found, so it burps when looking for this file on the network when I include these wildcard characters. Is there a certain data type I need to use? I use 'nvarchar'. Any thoughts?

Thanks in advance for any observations.
-David
 
Are you using "=" or "Like" in your SQL when searching for these file name? It should be:
Code:
ReportPath Like 'REPORT/^PDF/accountABC%.pdf'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top