December 5, 2010 at 5:50 pm
good evening:
i have a huge table tin sql 2000 and it has 1148052581
when i use select o select count_big(*) command it yields an error:
select count_big(*) from HECHOS_MOVTO_PREPAGO_ACTUACIONES
where FEC_ACTUALIZACION >= 20090201 and FEC_ACTUALIZACION <= 20091231
Arithmetic overflow error converting expression to data type datetime.
how can i handle this error and execute the query without any eroor?
id appreciate your help
December 5, 2010 at 5:56 pm
Single Quotes...
select count_big(*) from HECHOS_MOVTO_PREPAGO_ACTUACIONES
where FEC_ACTUALIZACION >= '20090201' and FEC_ACTUALIZACION <= '20091231'
--Jeff Moden
Change is inevitable... Change for the better is not.
December 5, 2010 at 6:04 pm
You are getting an implicit conversion, expecting SQL Server to convert those integer values for you. As Jeff mentioned, you want to use quotes around dates to explicitly state the values are dates and not numbers.
December 6, 2010 at 8:28 pm
pavargasq (12/5/2010)
id appreciate your help
Heh... we'd appreciate a little feedback. 😉 Did that fix it for you or not?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply