Home Can I pass DATEADD straight into a variable?
Reply: 0

Can I pass DATEADD straight into a variable?

user524 Published in July 17, 2018, 7:56 am

In one of the tSQLt tests I am writing I call a method with parameters to fill the expected table like so:

EXEC Test.Insert_Expected
    @CommencementDt = DATEADD(MONTH, 1, GETDATE)

However I am getting an error over the MONTH part of the second line reading:

'Incorrect syntax near MONTH, expecting ( or SELECT'

I'm new to using parameterised methods and was wandering why this wasn't working, and how I might solve it? Thanks

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309678 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO