Solved

sql server - dlookup

Posted on 2012-03-21
3
449 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

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

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…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 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