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

Using Wildcard to query large string

Status
Not open for further replies.

BigC72

MIS
Oct 15, 2004
69
US
We are currently exporting the Windows event logs from several of our Win2K servers to a SQL table and I would like to be able to query the description field (which has been converted to a string field in SQL) to look for certain elements here is an example:

Document 95 Microsoft Word - compliance program - J - Excluded Individuals- final.doc owned by trichard was printed on LJ32 via port IP_192.168.11.227. Size in bytes: 71717; pages printed: 1

I'm making the assumption that the only way to query it would be to use a wildcard. How would I set up my query to say query for all instances of a document printer on LJ32 (our printer naming scheme)?.

Also is it possible to build this query with a parameter so that it doesn't have to be manually edited each time the query changes?

 
Do you want to query in SQL or in Crystal?

SQL:

SELECT [columns] FROM myTable WHERE description LIKE '%LJ32%'

Crystal: (Record Selection Criteria)

description LIKE "*LJ32*"

What you're asking is really basic stuff. Try looking up parameter in help before bringing it to a forum.

BCrowe

BCrowe
 
Sir, with respect I did look up the information off-line first as I do with any questions that I post here. For whatever reason I was having difficulty getting my query within Crystal to perform properly which is why I posted my question.

If you fealt the question was "beneath" you or this forum then please don't reply to it and certainly don't lecture someone when you have no idea what they have or haven't done...
 
BigC72,

It would also help if you provide a little more technical Information when posting (see FAQ149-3762)

Since you are talking about a string that is more than 254 Characters and you have Crystal version 8.5 or higher installed, you may be able to use the Add Command along with a parameter. The gurus who have that version installed can verify that.

If you have Crystal 8.5 or less installed, then you may have to make your changes in Show SQL Query, which I have done. Might be able to do it in SQL Expressions but I haven't tried that yet. However, in either case, it will not work with parameters.

-LW

 
Thank you Wichitakid, my appologies for omitting the other pertinent information.

I am utilizing CR 8.5 so I will look into using the Add command as you suggested.

Thank you for your help...
 
Ooops. Error on my part. The Add command is in Crystal 9.0 and higher.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top