Solved

sql server - dlookup

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

914 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

21 Experts available now in Live!

Get 1:1 Help Now