Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sql server - dlookup

Posted on 2012-03-21
3
Medium Priority
?
453 Views
Last Modified: 2012-03-21
Hi,

What's the equivalent of Dlookup in SQL server 2005 syntax?

Instead of hard code the date and the number in this procedure, I would like to refer it to a field from a table in the server. Please let me know how to modify this.

@BaseYrBegin smalldatetime = '1/1/2010', @intProjWindow smallint = 6,
0
Comment
Question by:HNA071252
3 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 1600 total points
ID: 37749899
You mean something like this??

create table #table (crt_date smalldatetime)

insert into #table select '1/1/2010'
declare @BaseYrBegin smalldatetime
set  @BaseYrBegin = (select crt_date from #table);
print (@BaseYrBegin)

drop table #table
0
 
LVL 16

Assisted Solution

by:DcpKing
DcpKing earned 400 total points
ID: 37750007
There isn't such a thing. dLookup is a function (that you could easily write yourself in SQL) that you provide a table, a field, and a criterion. This is essentially the same as Select Field from Table where Criterion.
0
 

Author Closing Comment

by:HNA071252
ID: 37750147
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question