Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Converting and Access VLOOKUP Function to a SQL statement

Status
Not open for further replies.

penndro

Technical User
Jan 9, 2005
108
US
Hi I have recently converted my access database tables over to SQL Server 2008 and in the process of converting my queries to views on the server as well. I am having difficulties converting this access vlookup function and could use some help with the SQL Syntax:

DLookUp('Close','[ref_Stock Index]','([stockDate]) = '' & Format([VestDate],'mm\,dd\,yyyy') & '''))) AS VestRate

Any help would be appreciated.

Thanks
 
Arguments are

Table
Field
Criteria

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
So Skip, I am not so sure about the SQL structure to include this in my overall query. Can i call it like this:

FROM[ref_Stock Index]
SELECT[Close],
WHERE [in query].[VestDate] = [in lookup table].[Stock Date]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top