Loading ...
Sorry, an error occurred while loading the content.

RE: [SQLQueriesNoCode] Help with Replace

Expand Messages
  • Joe Fawcett
    In that cae my second solution should fix the issue.Joe http://joe.fawcett.name To: SQLQueriesNoCode@yahoogroups.comFrom: patrick@hkhealthy.comDate: Thu, 8 Jan
    Message 1 of 6 , Jan 8, 2009
    • 0 Attachment
      In that cae my second solution should fix the issue.Joe
      http://joe.fawcett.name



      To: SQLQueriesNoCode@yahoogroups.comFrom: patrick@...: Thu, 8 Jan 2009 10:18:17 +0800Subject: [SQLQueriesNoCode] Help with Replace



      Hi,I find that I get the following problem is because Replace() is a AccessVBA function, not a JET Sql function. When I run the sql from .net, itresonse a error.So, this is a dead end.But is there any way I can get a proper result:tblCustomerwith Fields1. CustomerName (String)2. PhoneNo (String)Input : 2474Output: both 247-4452-7752 and 24744527753 (etc.)I canot remove the hyphen from the database because my client havecustomer from all over the world, and some hyphen indicate country andarea code.Regards,PatrickHi,I use ASP.NET 2.0 with MSAccess Database.I have a old table tblCustomerwith Fields1. CustomerName (String)2. PhoneNo (String)Some of use input phone number 247-4452-7752, and others input24744527753.When we search the phone number, if we input 2474, I want to get resultwith both phone numbers (with or without hyphen)I build a query like SELECT CustomerName, PhoneNo FROM tblCustomer WHERE INSTR(REPLACE(PhoneNo, '-', ''), '2474')>0Above query can run ok inside Access. But when I run it inside ASP.NET,I was told REPLACE function is not defined.Anyone can help me?Regards,-- Patrick Chan <patrick@...>






      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.