I think the only way to check for that a year has passed is to use the day, and determine if it's greater than 365.
If DateDiff(dd,myDate,Current_Timestamp) > 365 Begin ............................. End -----Original Message----- From: Dina Hess [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 4:17 PM To: CF-Talk Subject: Re: transact-sql datediff function thanks for taking a look at it, margaret. but the whole idea is that i'm trying to find the difference (in years) between the hire date and today's date. ~ dina ----- Original Message ----- From: "Margaret Fisk" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, May 06, 2002 2:56 PM Subject: RE: transact-sql datediff function > Just a guess, but in the datediff you are just extracting the year. If you > want to include the > month in the calculation, you should probably get the month part too. > > Margaret > > -----Original Message----- > From: Dina Hess [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 06, 2002 11:20 AM > To: CF-Talk > Subject: OT: transact-sql datediff function > > > 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 > > > ______________________________________________________________________ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm 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