Board index » delphi » Simple ACCESS query problem

Simple ACCESS query problem

I'm trying to perform a simple query through ADO to Access 2000
using following syntax:

select field1,field2 from table where field1 = 'a*z';

I get nothing in the result set

When I ask for everything (select * from table), I get everything

Is there something goofy with Access SQL that I'm missing.

TIA
kma

 

Re:Simple ACCESS query problem


Are you positive you have a field1 in table that equals 'a*z'? You will have
an empty result set if you do not have that in table. Also if a and z are
numbers and your trying to match an integer up you will need to remove the
single quotes.

Quote
"kma" <k...@nospam.net> wrote in message

news:3e690a6d$1@newsgroups.borland.com...
Quote
> I'm trying to perform a simple query through ADO to Access 2000
> using following syntax:

> select field1,field2 from table where field1 = 'a*z';

> I get nothing in the result set

> When I ask for everything (select * from table), I get everything

> Is there something goofy with Access SQL that I'm missing.

> TIA
> kma

Re:Simple ACCESS query problem


Try the next:
select field1,field2 from table where field1 LIKE 'a%z';

--
With best regards, Mike Shkolnik
E-mail: mshkol...@scalabium.com
WEB: http://www.scalabium.com

Quote
"kma" <k...@nospam.net> wrote in message

news:3e690a6d$1@newsgroups.borland.com...
Quote
> I'm trying to perform a simple query through ADO to Access 2000
> using following syntax:

> select field1,field2 from table where field1 = 'a*z';

> I get nothing in the result set

> When I ask for everything (select * from table), I get everything

> Is there something goofy with Access SQL that I'm missing.

> TIA
> kma

Re:Simple ACCESS query problem


Thanks
Quote
"Mike Shkolnik" <mshkolnik2...@ukr.net> wrote in message

news:3e69113c@newsgroups.borland.com...
Quote
> Try the next:
> select field1,field2 from table where field1 LIKE 'a%z';

> --
> With best regards, Mike Shkolnik
> E-mail: mshkol...@scalabium.com
> WEB: http://www.scalabium.com

> "kma" <k...@nospam.net> wrote in message
> news:3e690a6d$1@newsgroups.borland.com...
> > I'm trying to perform a simple query through ADO to Access 2000
> > using following syntax:

> > select field1,field2 from table where field1 = 'a*z';

> > I get nothing in the result set

> > When I ask for everything (select * from table), I get everything

> > Is there something goofy with Access SQL that I'm missing.

> > TIA
> > kma

Re:Simple ACCESS query problem


Quote
"Brian Hollister" <bhollisterATfuturaintlDOTcom> wrote in message

news:3e6910c1$1@newsgroups.borland.com...

Quote
> Are you positive you have a field1 in table that equals 'a*z'? You will
have
> an empty result set if you do not have that in table. Also if a and z are
> numbers and your trying to match an integer up you will need to remove the
> single quotes.

'*' is the ODBC wildcard character.  He needs to use '%' with OLE DB.

--

 A: Top-posters.
 Q: What is the most annoying thing on Usenet?

Other Threads