x

Stored procedure that returns time +additional hours.

I want to create a stored procedure that gives me time + the number of hours i am adding or subtracting..For eg:The stored Procedure gives me current time as 12-8-2012 9:00 am and i will pass +2 ...so the stored procedure will give me 12-8-2012 11:00 am.
more ▼

asked Aug 25, 2012 at 01:46 PM in Default

fashraf gravatar image

fashraf
398 12 14 20

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

So what you need to do is CREATE a PROCEDURE that makes use of the DATEADD function...

I'm not going to answer the question fully, because it looks like homework...

more ▼

answered Aug 25, 2012 at 08:07 PM

ThomasRushton gravatar image

ThomasRushton ♦
33.8k 18 20 44

Thanks a ton..Sorry to bother you !
Aug 26, 2012 at 07:07 AM fashraf
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x407
x28

asked: Aug 25, 2012 at 01:46 PM

Seen: 671 times

Last Updated: Aug 26, 2012 at 07:07 AM