how to use dateadd to add 1 day + 10 minutes

Hi!

This is the query i have!  it works fine but i want to edit it a little!
As you can see it now adds 1 day to  "on_date_time". i need it to add 1 day + 10 minutes??
Any Ideas ?

Insert into ttsessions
    (mobile_id,cust_id,on_date_time,off_date_time,[length],approved,burntime,complete,price,changed)
Select
     mobile_id,cust_id,dateadd(d,+1,convert(char(8),on_date_time,112)),off_date_time,length],approved,burntime,complete,price,
changed

 from #temp

/J
jamppiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee SavidgeCommented:
select dateadd(minute, 1450, getdate())

Lee
0
RiteshShahCommented:
declare @dt datetime
set @dt='10/10/10'
select @dt,DATEADD(day,1,@dt) as dayAdd,DATEADD(minute,10,@dt) MinAdd,dateadd(minute,10,DATEADD(day,1,@dt)) as dayandMinAdd
0
Lee SavidgeCommented:
To be specific, try this.

Lee
Insert into ttsessions
    (mobile_id,cust_id,on_date_time,off_date_time,[length],approved,burntime,complete,price,changed)
Select
     mobile_id,cust_id,dateadd(minue,1450,convert(char(8),on_date_time,112)),off_date_time,length],approved,burntime,complete,price,
changed

 from #temp

Open in new window

0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Lee W, MVPTechnology and Business Process AdvisorCommented:
How many minutes are in a day?  1440.  Add 1450 minutes and you add 1 day + 10 minutes.  I don't recall the specific value in SQL, but in vbscript it would be "n" for miNutes
0
Lee SavidgeCommented:
Typo.

Lee
Insert into ttsessions
    (mobile_id,cust_id,on_date_time,off_date_time,[length],approved,burntime,complete,price,changed)
Select
     mobile_id,cust_id,dateadd(minute,1450,convert(char(8),on_date_time,112)),off_date_time,length],approved,burntime,complete,price,
changed

 from #temp

Open in new window

0
jamppiAuthor Commented:
Hi!  

maybe i need to clarify a little!

now the query inserts 1 day!
 
if on_date_time is   for example 2010-04-15 12:12:12  it needs to set to  2010-04-16 00:10:00.

meaning.. Jump to next day midnight and add 10 minutes

adding 1450 minutes will be wrong!

/j
0
Lee SavidgeCommented:
Ahh, right ok. Try this.

Lee
Insert into ttsessions
    (mobile_id,cust_id,on_date_time,off_date_time,[length],approved,burntime,complete,price,changed)
Select
     mobile_id,cust_id,dateadd(minute, 10, convert(datetime, convert(nvarchar(10), on_date_time + 1, 112), 112)),off_date_time,length],approved,burntime,complete,price,
changed

 from #temp

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jamppiAuthor Commented:
Thank you, Perfect!
0
Lee SavidgeCommented:
Glad to help.

Lee
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.