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
 find the DateDiff of the nvarchar against getdate

Author  Topic 

shanmugaraj
Posting Yak Master

219 Posts

Posted - 2014-08-19 : 02:15:32
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 - 2014-08-19 : 02:25:43
select getdate(), DateString
---, getdate()- DateString as DateDiff
, DATEDIFF(DAY, DateString, getdate())
from dbo.DateChk


THANKS
SHANMUGARAJ
nshanmugaraj@gmail.com
Go to Top of Page
   

- Advertisement -