ASKER
insert into chequetmp
select *
from nopagados
where convert (datetime,estimado)>= '20150209' and convert(datetime,estimado) <= '20150210'
One reason this wouldn't be working is that SQL 2000 had only the date data type (without the time), and versions after 2008 have date and time. Note the change to 20150210. See SQL Server Date Styles (formats) using CONVERT() for an excellent reference. SELECT estimado
FROM nopagados
WHERE ISDATE(estimado) = 0
Or this will work in any SSMS
CREATE TABLE #tmp (val varchar(10))
INSERT INTO #tmp (val) VALUES ('01-01-2010'), ('05-24-2016'), ('12-25-0001'), ('banana')
-- All values
SELECT * FROM #tmp
-- Values that can't be converted to a date
SELECT * FROM #tmp WHERE ISDATE(val) = 0
So if any rows are returned, then you're going to have to figure out what to do with these non-date values such that they can be converted to date format. ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY