Trouble with updating a DATE in SQL table

I am having trouble updating a DATE in SQL table.
My code is:
Update Customer Set LTEmailOKSendYN=0, LTEmailDate=DATEADD(month, 9, LTEmailDate)
	Where MainID=@MainID

Open in new window

I am trying to add 9 months to the date currently in the SQL table (LTEmailDate).
I am getting very weird results! Help!
SOTAAsked:
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.

Scott PletcherSenior DBACommented:
Don't know specifically what you mean by "weird", but your UPDATE looks fine:

Update Customer
Set
    LTEmailOKSendYN=0,
    LTEmailDate=DATEADD(month, 9, LTEmailDate)
Where MainID=@MainID
0
ste5anSenior DeveloperCommented:
Weird? How comes?

btw, posting a concise and complete sample would help. Context!
0
SOTAAuthor Commented:
Sorry! If the date set in LTEmailDate = '1/1/2018' (Jan 1, 2018) and I run the SQL statement, LTEmailDate gets set to '7/1/2019' (July 1, 2019)
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!

Scott PletcherSenior DBACommented:
Best (educated) guess: somehow the UPDATE is occurring twice; 18 months were added rather than 9.

May also want to look for trigger(s) on the table.
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
SOTAAuthor Commented:
Ah yes!! That could be it!
I will check my code!
Thanks!
0
SOTAAuthor Commented:
OK...brilliant!!! That was it! I had a loop in there that ran the code twice. Whew!!! Thanks EXPERTS!!!
0
SOTAAuthor Commented:
Ya'll are great to have "out there". :-)
0
Scott PletcherSenior DBACommented:
Great, glad we could help!
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
SQL

From novice to tech pro — start learning today.