Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Query

Author  Topic 

PeeJay2583
Starting Member

40 Posts

Posted - 2011-05-18 : 08:56:41
Hi,

I want to make a query in sql from access.

In access in where clause we have used DLOOKUP which doesn't work in sql.

where clause is like , where table1.name = dlookup("[report name]","table2")

How can I change this dlookup as sql doesn't support it.

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2011-05-18 : 09:03:15
where table1.name = ( SELECT TOP 1
[report name]
FROM table2
)

--------------------------
http://connectsql.blogspot.com/
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-05-18 : 09:10:58
you could connect Access to SQL Server, use a trace and see what he does with that code exactly

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

PeeJay2583
Starting Member

40 Posts

Posted - 2011-05-18 : 09:22:04
What's this TOP 1 for?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2011-05-18 : 09:26:42
pretty self explanatory,

Do you have Books Online for SQL Server?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

PeeJay2583
Starting Member

40 Posts

Posted - 2011-05-18 : 10:09:39
It works thanks.
Go to Top of Page
   

- Advertisement -