SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 find the DateDiff of the nvarchar against getdate
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shanmugaraj
Posting Yak Master

219 Posts

Posted - 08/19/2014 :  02:15:32  Show Profile  Send shanmugaraj a Yahoo! Message  Reply with Quote
create table dbo.DateChk
([DateString] [nvarchar](24) NULL)
insert into dbo.DateChk (DateString) values ('20130112'),('20131121'), ('20130924'),('20130515')

select getdate(), DateString
---, getdate()- DateString as DateDiff
from dbo.DateChk
kindly provide the way to find the DateDiff of the nvarchar against getdate



THANKS
SHANMUGARAJ
nshanmugaraj@gmail.com

shanmugaraj
Posting Yak Master

219 Posts

Posted - 08/19/2014 :  02:25:43  Show Profile  Send shanmugaraj a Yahoo! Message  Reply with Quote
select getdate(), DateString
---, getdate()- DateString as DateDiff
, DATEDIFF(DAY, DateString, getdate())
from dbo.DateChk


THANKS
SHANMUGARAJ
nshanmugaraj@gmail.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000