Friday, January 23, 2009

Select top and last five record from Database

In Query try this:
FOR TOP 5
select top 5 * from table
//——————-
FOR LAST 5
select top 5 * from table order by primarykey_columnname desc

Good Luck

Get Month Name from SQL

Hitry this SQL query to get month name
SELECT ID,datename(month,PostDate) as Month FROM yourTable
where PostDate is field in my table of datetime type

Good Luck