Solved

sql server - dlookup

Posted on 2012-03-21
3
440 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 39

Accepted Solution

by:
lcohan earned 400 total points
Comment Utility
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 100 total points
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Remove extra commas from beginning of string 5 43
PK numbers not follow 8 48
Sql query 12 65
SQL Where not exists in same table 3 40
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now