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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 TIME AND DATE

Author  Topic 

DENIZ3E
Yak Posting Veteran

56 Posts

Posted - 2005-12-13 : 19:32:09
HI,
I have got a Table but ý dont know use (TIME coloumn) in this table
ID(INT) Date_(DATETIME)Time(INT)
--- ---- -------
1 12.09.2005 371339351
2 12.09.2005 371394746

I want to find MAX(DATE) in this table but DATE_ + TIME
How I can convert Date_ + Time = Datetime

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-14 : 00:13:18
Select id, dateCol from
(
select top 1 id,dateCol, dateDiff(day,dateCol,getdate())+timeCol as NewTime from yourTable order by newTime DESC
) T


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -