Solved

sql server - dlookup

Posted on 2012-03-21
3
443 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
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 100 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MessageHandler Database in SQL way too large 4 46
Stored procedure 4 32
Pivot Query Problem 9 41
Help Required 2 32
by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 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