PC Review


Reply
Thread Tools Rate Thread

Problems with LIKE in SQL

 
 
VB Programmer
Guest
Posts: n/a
 
      13th Sep 2004
Using ASPX page with Access db.

When I run a query in Access it returns many records. When I run it via
ADO.NET it returns 0.

It uses a LIKE statement in the WHERE clause. Here's the statement:
SELECT [Employees].[LastName] & ', ' & [Employees].[FirstName] AS AreaMgr,
Stores.StoreName AS StoreName, Stores.StoreId AS StoreId,
Stores.NumberQCRequired AS NumberQCRequired, Plan.PlanDate AS PlanDate,
Employees.RegionalDirectorId, Stores.StoreTypeId FROM (Employees INNER JOIN
Stores ON Employees.EmployeeId = Stores.AreaManager) LEFT JOIN Plan ON
Stores.StoreId = Plan.StoreId WHERE ((Plan.PlanDate >= #9/1/2004# AND
Plan.PlanDate < #10/1/2004#) Or (Plan.PlanDate Is Null)) AND
(Stores.StoreName LIKE 'Home*') ORDER BY Stores.StoreName, Plan.PlanDate;

Any ideas?

Thanks!


 
Reply With Quote
 
 
 
 
VB Programmer
Guest
Posts: n/a
 
      13th Sep 2004
Thanks.

What is the symbol for only 1 character?

"Jay Pondy" <(E-Mail Removed)> wrote in message
news:AF53B556-5309-426E-99C0-(E-Mail Removed)...
> Change the '*' to '%'
>
> "VB Programmer" wrote:
>
> > Using ASPX page with Access db.
> >
> > When I run a query in Access it returns many records. When I run it via
> > ADO.NET it returns 0.
> >
> > It uses a LIKE statement in the WHERE clause. Here's the statement:
> > SELECT [Employees].[LastName] & ', ' & [Employees].[FirstName] AS

AreaMgr,
> > Stores.StoreName AS StoreName, Stores.StoreId AS StoreId,
> > Stores.NumberQCRequired AS NumberQCRequired, Plan.PlanDate AS PlanDate,
> > Employees.RegionalDirectorId, Stores.StoreTypeId FROM (Employees INNER

JOIN
> > Stores ON Employees.EmployeeId = Stores.AreaManager) LEFT JOIN Plan ON
> > Stores.StoreId = Plan.StoreId WHERE ((Plan.PlanDate >= #9/1/2004# AND
> > Plan.PlanDate < #10/1/2004#) Or (Plan.PlanDate Is Null)) AND
> > (Stores.StoreName LIKE 'Home*') ORDER BY Stores.StoreName,

Plan.PlanDate;
> >
> > Any ideas?
> >
> > Thanks!
> >
> >
> >



 
Reply With Quote
 
VB Programmer
Guest
Posts: n/a
 
      13th Sep 2004
I found it: _

"VB Programmer" <Dont*NoSpam-Please*@jEmail.com> wrote in message
news:%(E-Mail Removed)...
> Thanks.
>
> What is the symbol for only 1 character?
>
> "Jay Pondy" <(E-Mail Removed)> wrote in message
> news:AF53B556-5309-426E-99C0-(E-Mail Removed)...
> > Change the '*' to '%'
> >
> > "VB Programmer" wrote:
> >
> > > Using ASPX page with Access db.
> > >
> > > When I run a query in Access it returns many records. When I run it

via
> > > ADO.NET it returns 0.
> > >
> > > It uses a LIKE statement in the WHERE clause. Here's the statement:
> > > SELECT [Employees].[LastName] & ', ' & [Employees].[FirstName] AS

> AreaMgr,
> > > Stores.StoreName AS StoreName, Stores.StoreId AS StoreId,
> > > Stores.NumberQCRequired AS NumberQCRequired, Plan.PlanDate AS

PlanDate,
> > > Employees.RegionalDirectorId, Stores.StoreTypeId FROM (Employees INNER

> JOIN
> > > Stores ON Employees.EmployeeId = Stores.AreaManager) LEFT JOIN Plan ON
> > > Stores.StoreId = Plan.StoreId WHERE ((Plan.PlanDate >= #9/1/2004# AND
> > > Plan.PlanDate < #10/1/2004#) Or (Plan.PlanDate Is Null)) AND
> > > (Stores.StoreName LIKE 'Home*') ORDER BY Stores.StoreName,

> Plan.PlanDate;
> > >
> > > Any ideas?
> > >
> > > Thanks!
> > >
> > >
> > >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems starting command prompt on cygwin on vista ultimate, problems not had on Win2k3SP2 qa4ever Windows Vista General Discussion 1 9th Oct 2008 01:10 PM
Plan Plus v 3 (and Outlook 2003 SP2) - install problems, uninstall problems, bugs? dubya Microsoft Outlook Third-Party Utilities 0 25th Dec 2005 11:57 PM
Corrected post -Poll-Xp sp2 windows update problems vs. Xp sp2 network install problems. Greg R Windows XP General 2 26th Aug 2004 02:14 PM
Problems problems problems with GetProcessesByName(ProcessName,this.IPAddress) Arne Janning Microsoft C# .NET 7 10th Jun 2004 06:42 PM
IP Problems, DCOM Problems, system time problems Rhonda Windows XP Performance 0 20th May 2004 06:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:44 PM.