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!

Why no wildcard in SQL when in select criteria?

Status
Not open for further replies.
Jun 4, 2004
19
US
Hi all,

I have something strange happening with my report running on a SQL Server database. My select criteria includes the following:

{LPlusOpenInvoiceHistoryVW.invhst_register_type} like ["NOTE*", "RENT*", "INSTP*"]

but the SQL sent to the server (viewed from the Database/Show SQL Query menu option) for this piece is as follows:

("LPlusOpenInvoiceHistoryVW"."invhst_register_type" LIKE 'INSTP' OR "LPlusOpenInvoiceHistoryVW"."invhst_register_type" LIKE 'NOTE%' OR "LPlusOpenInvoiceHistoryVW"."invhst_register_type" LIKE 'RENT%')

Notice that LIKE INSTP* in the select criteria for some reason loses the wildcard before it's sent to the server. Why does this happen and how can I make it read my select criteria properly??

Many thanks.


Robin

 
Try:

(
{LPlusOpenInvoiceHistoryVW.invhst_register_type} like "NOTE*"
or
{LPlusOpenInvoiceHistoryVW.invhst_register_type} like "RENT*"
or
{LPlusOpenInvoiceHistoryVW.invhst_register_type} like "INSTP*"
)

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top