user1449596
user1449596

Reputation: 309

dlookup function in access

I'm first time trying to use dlookup function in access as below but I get blank output.

select dlookup ("quantity","test","series > 2000") from test

This is test table

 id series  quantity
 1  1000    25
 2  2000    33
 3  3000    44
 4  4000    55
 5  5000    66
 6  6000    77

I thought the above query will display all records from the table below which has series more than 2000 i.e. as below but it displays blank result.

 id series  quantity
 3  3000    44
 4  4000    55
 5  5000    66
 6  6000    77

I'm not sure if my syntax is incorrect or anything else. I already double checked my syntax from various sources though.

Upvotes: 1

Views: 542

Answers (1)

HansUp
HansUp

Reputation: 97101

DLookup() returns a single value, which is not what I think you want. Just put your selection constraint in the WHERE clause.

SELECT id, series, quantity
FROM test
WHERE series > 2000;

Upvotes: 1

Related Questions