September 16, 2008 at 12:21 am
how do i minus 12 hours from current time
September 16, 2008 at 1:23 am
More than 1 way to do it, but I find the easiest to write is:-
SELECT getdate() - 0.5
This subtracts half a day from the current date
September 16, 2008 at 1:55 am
Hi Ian,
thanks can you give me one another method and also how i can get only the time part from a date
September 16, 2008 at 2:01 am
September 26, 2008 at 6:42 am
select right(Convert(varchar(20),getdate()),7) will give the timepart of a datetime variable.
September 26, 2008 at 8:19 am
dateadd(hour, -12,getdate()) is an example also
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply