Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I am using the DotNetNuke report module that allows a sql statement to pull data from a SQL2005 server. Here's my issue, the dates for the specific database (a BridgeTrak80 database) is that the date/time is stored simply as YYYYMMDDHHMMSS instead of the standard SQL format for datetimes. Therefore, it will not let me do a "datediff()" with that value. Any ideas how I can possibly do something like:
where DATEDIFF(mm,IS_COMPLETED_DATE,NOW())=0
Any and all help is greatly appreciated!!
Lamprey
Master Smack Fu Yak Hacker
4614 Posts
Posted - 2010-06-28 : 19:11:13
Your date/time is stores as a varchar column? There are a several ways to convert it to a DATETIME. Here is one: