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)
 date format issue

Author  Topic 

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2005-09-29 : 19:49:40
When I use this query to get max date it gives me correct format as
2005-09-29 14:38:42.440
select max(date_received)as max_date_received from tbl_funds

But when I try to use the same query in a dts and compare with another date it gives me an output as 9/29/2005 2:38:42 PM
and
whenever i have a comparison of these with other dates.Its failing becasue

9/29/2005 2:38:42 PM < 2005-09-29 14:38:42.440.

Please how should i over come this

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-09-29 : 20:04:08
CONVERT(CHAR(23),max(date_recieved),121)
might be a workaround...

DTS.. say no more...
Go to Top of Page

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2005-09-29 : 21:42:13
Thanks It works .......
Go to Top of Page
   

- Advertisement -