Mar 24, 2004 #1 DiggerDog Programmer Nov 24, 2002 60 AU Hi I need to compare two datetime fields but wish to drop the datetime component of the datatype - is this possible E.g I want 2004-03-24 16:14:23.400 to = 2004-03-24 6:14:23.67
Hi I need to compare two datetime fields but wish to drop the datetime component of the datatype - is this possible E.g I want 2004-03-24 16:14:23.400 to = 2004-03-24 6:14:23.67
Mar 24, 2004 1 #2 MDXer Technical User Oct 19, 2002 1,982 US you can use a convert function with a style of 120 "Shoot Me! Shoot Me NOW!!!" - Daffy Duck Upvote 0 Downvote
you can use a convert function with a style of 120 "Shoot Me! Shoot Me NOW!!!" - Daffy Duck
Mar 24, 2004 Thread starter #3 DiggerDog Programmer Nov 24, 2002 60 AU Hi MDXer I tried using convert with a style of 120 before but it still returned the millisecond part See code below Declare @Date datetime select @Date = getdate() select @Date -- returned 2004-03-25 11:34:11.670 select @Date = Convert(datetime, @date, 120) select @Date -- returned 2004-03-25 11:34:11.670 Upvote 0 Downvote
Hi MDXer I tried using convert with a style of 120 before but it still returned the millisecond part See code below Declare @Date datetime select @Date = getdate() select @Date -- returned 2004-03-25 11:34:11.670 select @Date = Convert(datetime, @date, 120) select @Date -- returned 2004-03-25 11:34:11.670
Mar 24, 2004 #4 MDXer Technical User Oct 19, 2002 1,982 US convert to a varchar Code: select @Date = Convert(varchar, @date, 120) [code] "Shoot Me! Shoot Me NOW!!!" - Daffy Duck Upvote 0 Downvote
convert to a varchar Code: select @Date = Convert(varchar, @date, 120) [code] "Shoot Me! Shoot Me NOW!!!" - Daffy Duck
Mar 24, 2004 Thread starter #5 DiggerDog Programmer Nov 24, 2002 60 AU Hi MDXer That works perfectly - Thanks for your help Upvote 0 Downvote