Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
gangadhara.ms
Aged Yak Warrior
549 Posts |
Posted - 2009-12-30 : 05:33:28
|
| Dear All,I have a table structure like this..EmpID | Fromdate 1 | 1985-10-312 | 1972-01-123 | 2000-12-08By considering "2010-10-31" as a Reference date I need to get the difference in days between Fromdate and Reference date .Thanks,Gangadhar |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-12-30 : 05:39:15
|
| select DATEDIFF(d,Fromdate,'2010-10-31') from table_nameSenthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
rajdaksha
Aged Yak Warrior
595 Posts |
Posted - 2009-12-30 : 05:40:29
|
| SELECT DATEDIFF(DAY,Fromdate,'2010-10-31')as DatedifftFROM <Table>You can use DATEDIFF in the select list, WHERE, HAVING, GROUP BY and ORDER BY clauses-------------------------R... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-02 : 01:45:41
|
| is Fromdate datetime field? if not, will the date formats of values be consistent? |
 |
|
|
|
|
|