Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select statement with TOP 1.

Author  Topic 

hspatil31
Posting Yak Master

182 Posts

Posted - 2012-02-08 : 04:16:19
Hello All,

I am trying following query. I want to get the output in @ANProcessRecordCount

How to resolve resolve following query ?

DECLARE @ANProcessRecordCount VARCHAR(36)

SELECT @ANProcessRecordCount = TOP 1 Description FROM tb_lcr_activity WHERE Name = 'ABC' ORDER BY Created_Date DESC


Thanks and Regard's
Harish Patil

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-02-08 : 04:26:11
Can you explain where is the problem please?
Error message or anything?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2012-02-08 : 04:37:47
SELECT TOP 1 @ANProcessRecordCount = Description FROM tb_lcr_activity WHERE Name = 'ABC' ORDER BY Created_Date DESC
Go to Top of Page

hspatil31
Posting Yak Master

182 Posts

Posted - 2012-02-08 : 05:32:55
Thnks. I resolved my issue.

Thanks and Regard's
Harish Patil
Go to Top of Page
   

- Advertisement -