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
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Unable see result of a column

Author  Topic 

madpop1
Starting Member

4 Posts

Posted - 2014-11-30 : 00:54:28
Hi friends im having a problem here i have created a table with below format

city nvarchar(255)
company nvarchar(255)
country nvarchar(255)
date nvarchar(255)
expired bit
indeedApply bit
jobkey nvarchar(255)

if u see "date" column in that column i have insterted the data like this " Sun, 09 Nov 2014 11:21:48 GMT " now i want to displa posting of the data of last 7 days the contents of the data is like this

date
Sun, 09 Nov 2014 11:21:48 GMT
Fri, 24 Nov 2014 20:48:42 GMT
Fri, 20 Nov 2014 22:31:35 GMT
Fri, 18 Nov 2014 19:32:46 GMT
Fri, 21 Nov 2014 16:20:09 GMT
Sun, 20 Nov 2014 06:06:39 GMT
Sat, 19 Nov 2014 06:52:27 GMT

from this i want to retrieve the date of nov 30-20

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2014-11-30 : 02:32:40
what is the query you are currently using?

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

viggneshwar
Yak Posting Veteran

86 Posts

Posted - 2014-12-04 : 09:39:39
select cast(Left(STUFF('Sun, 09 Nov 2014 11:21:48 GMT',1,5,''),20) as datetime)

Regards
Viggneshwar A
Go to Top of Page
   

- Advertisement -