March 13, 2006 at 2:35 pm
My bad, hire date is less then 90 days from today
March 13, 2006 at 2:48 pm
Can you just code what you are asking for?
Look:
"hire date is greater then 90 days from today"
can be easily traslated to:
hire_date > dateadd(dd, -90, Getdate() )
Why to complicate own life?
_____________
Code for TallyGenerator
March 13, 2006 at 2:50 pm
Try this:
SELECT * FROM myTable WHERE hire_date > (CONVERT(VARCHAR,getdate()-90, 110))
- Tahsin
March 13, 2006 at 4:32 pm
March 13, 2006 at 4:35 pm
So what?
"hire date is less then 90 days from today"
can be easily traslated to:
hire_date < dateadd(dd, -90, Getdate() )
_____________
Code for TallyGenerator
March 13, 2006 at 7:02 pm
Thank You for the help. Hopefully I'll catch on to this T-SQL stuff quickly.
March 14, 2006 at 6:26 am
see anything wrong with this? just curious with the difference would be and why you chose dataadd over datediff
where datediff(d,hire_date,GETDATE()) <= 90
thanks!!!
March 14, 2006 at 11:30 am
This version makes using of indexes impossible.
_____________
Code for TallyGenerator
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply