From: resonance on
Hello, I have a "results table" in access database like following:

results
----------------------
lab id
--- ---
12 1
12 2
12 6
13 1
13 3


I need all "id" of lab 12 for example. I have written a sql statement but it
does not return anythig.
SELECT id FROM results WHERE lab=12

How can I choose all "id" of a certain lab?
From: Arne Vajhøj on
On 16-06-2010 10:00, resonance wrote:
> Hello, I have a "results table" in access database like following:
>
> results
> ----------------------
> lab id
> --- ---
> 12 1
> 12 2
> 12 6
> 13 1
> 13 3
>
>
> I need all "id" of lab 12 for example. I have written a sql statement but it
> does not return anythig.
> SELECT id FROM results WHERE lab=12
>
> How can I choose all "id" of a certain lab?

Your SQL is correct as the problem is presented.

I suspect that there is something relevant that
you are not presenting.

Arne

From: Everest on
On Jun 16, 7:00 pm, resonance <resona...(a)discussions.microsoft.com>
wrote:
> Hello, I have a "results table" in access database like following:
>
> results
> ----------------------
> lab    id
> ---    ---
> 12     1
> 12     2
> 12     6
> 13     1
> 13     3
>
> I need all "id" of lab 12 for example. I have written a sql statement but it
> does not return anythig.
> SELECT id FROM results WHERE lab=12
>
> How can I choose all "id" of a certain lab?


Try using:
SELECT [id] FROM results WHERE lab=12
From: resonance on
I have solved my problem, thank you...

"Everest" wrote:

> On Jun 16, 7:00 pm, resonance <resona...(a)discussions.microsoft.com>
> wrote:
> > Hello, I have a "results table" in access database like following:
> >
> > results
> > ----------------------
> > lab id
> > --- ---
> > 12 1
> > 12 2
> > 12 6
> > 13 1
> > 13 3
> >
> > I need all "id" of lab 12 for example. I have written a sql statement but it
> > does not return anythig.
> > SELECT id FROM results WHERE lab=12
> >
> > How can I choose all "id" of a certain lab?
>
>
> Try using:
> SELECT [id] FROM results WHERE lab=12
> .
>
From: Jeff Johnson on
"Everest" <pantmunish(a)gmail.com> wrote in message
news:5b5968c8-93d8-4a86-a5aa-53d7cc197cbf(a)s6g2000prf.googlegroups.com...

> Try using:
> SELECT [id] FROM results WHERE lab=12

I'm not aware of any dialect of SQL where id is a reserved word, so I doubt
that was the problem.