hi all,

i posted this on the sql list but got no response.

i have a test table named employees with the following fields:

fname varchar
lname varchar
hire_date datetime

the record i'm querying contains 2001-05-11 00:00:00.000 in the
hire_date field. but this query returns 1 rather than the
expected 0:

select datediff(yy, hire_date, getdate()) as yearsdiff from
employees where fname = 'ann'

this should give me the number of years between 5/11/2001 and
today's date of 5/6/2002, which should be 0 since it's not 5/11
yet. so why am i getting 1???

~ dina

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to