Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2003. I have a module that grabs some data from an SQL database using
an ADODB connection. If I use the following in the SQL query, it returns no data: (WHERE INVOICENUMBER LIKE 'MS*') However, if I use the following, I get all the data I expect: (WHERE INVOICENUMBER='MS' AND INVOICENUMBER<='MS9999999999999') What am I doing wrong? How may I properly use the LIKE phrase? Thanks for any help. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try using a % symbol instead of a * symbol
I bleieve * symbol is used with MS Access and % is used with SQL "Chaplain Doug" wrote: Excel 2003. I have a module that grabs some data from an SQL database using an ADODB connection. If I use the following in the SQL query, it returns no data: (WHERE INVOICENUMBER LIKE 'MS*') However, if I use the following, I get all the data I expect: (WHERE INVOICENUMBER='MS' AND INVOICENUMBER<='MS9999999999999') What am I doing wrong? How may I properly use the LIKE phrase? Thanks for any help. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could try LIKE 'MS%', the like clause in SQL uses % instead of * but I
would have expected ADO to do the conversion for you. "Chaplain Doug" wrote in message ... Excel 2003. I have a module that grabs some data from an SQL database using an ADODB connection. If I use the following in the SQL query, it returns no data: (WHERE INVOICENUMBER LIKE 'MS*') However, if I use the following, I get all the data I expect: (WHERE INVOICENUMBER='MS' AND INVOICENUMBER<='MS9999999999999') What am I doing wrong? How may I properly use the LIKE phrase? Thanks for any help. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you both for the help. God bless.
-- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org "Terry Aney" wrote: You could try LIKE 'MS%', the like clause in SQL uses % instead of * but I would have expected ADO to do the conversion for you. "Chaplain Doug" wrote in message ... Excel 2003. I have a module that grabs some data from an SQL database using an ADODB connection. If I use the following in the SQL query, it returns no data: (WHERE INVOICENUMBER LIKE 'MS*') However, if I use the following, I get all the data I expect: (WHERE INVOICENUMBER='MS' AND INVOICENUMBER<='MS9999999999999') What am I doing wrong? How may I properly use the LIKE phrase? Thanks for any help. -- Dr. Doug Pruiett Good News Jail & Prison Ministry www.goodnewsjail.org |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
=SUBSTITUTE(C4,"~?#","") will this work to remove multiple string | Excel Worksheet Functions | |||
How do I "insert copied cells"? used to be "alt i e" still work | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
pictures to work with "data" "sort" option | Excel Discussion (Misc queries) | |||
Why doesn't "Workbook.Range("myrange").value" work? | Excel Programming |