Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

how to user id to show in from date to upto date in mssql server

-- [=====[ Option 1 ]=====]
SELECT	TOP 1 
        TransID, [Date] 
FROM    #RNT1 
ORDER BY [Date] DESC, 
         TransID DESC

-- [=====[ Option 2 ]=====]
SELECT TOP 1 
       TransID, [Date]
FROM   #RNT1
WHERE  [Date]= (SELECT Max([Date]) FROM #RNT1)
ORDER BY TransID DESC
Source by www.codeproject.com #
 
PREVIOUS NEXT
Tagged: #user #id #show #date #upto #date #mssql #server
ADD COMMENT
Topic
Name
9+8 =