Board index » delphi » URGENT! VERY URGENT!!

URGENT! VERY URGENT!!

Hi

I've got the client breathing down my neck........

I want to search a database on two fields. How do I do that?
I believe I must use locate, but how?

My Database looks as follows:
Field 1        Field 2        Field 3
aa                    1
aa                    2
aa                    1
bb                    2
bb                    1
bb                    2
aa                    1
aa                    2
cc                    1
dd                    1

i'm trying to find aa 1
i.e Field 1 = aa and Field 2 =1

Any help will be appreciated

Michiel Neethling

 

Re:URGENT! VERY URGENT!!


Quote
"Michiel Neethling" <mwns...@iafrica.com> wrote in message

news:399828dd.0@news1.mweb.co.za...

Quote
> Hi

> I've got the client breathing down my neck........

> I want to search a database on two fields. How do I do that?
> I believe I must use locate, but how?

> My Database looks as follows:
> Field 1        Field 2        Field 3
> aa                    1
> aa                    2
> aa                    1
> bb                    2
> bb                    1
> bb                    2
> aa                    1
> aa                    2
> cc                    1
> dd                    1

> i'm trying to find aa 1
> i.e Field 1 = aa and Field 2 =1

> Any help will be appreciated

If you simply want to find the first record that matches the criteria then

    Locate ("Field 1;Field 2", VarArrayOf (['aa', 1]), [])

If you want all records that match the criteria then use a query or filter.

Re:URGENT! VERY URGENT!!


"Michiel Neethling" <mwns...@iafrica.com> skrev i en meddelelse
news:399828dd.0@news1.mweb.co.za...

Quote
> i'm trying to find aa 1
> i.e Field 1 = aa and Field 2 =1

A simple query can do that:
  Select * from "whatever"
  where Field1 = 'aa' and Field2 = 1

Finn Tolderlund

Other Threads