Death and Syntaxes

Fellow Tessiturians,

My Membership Update Opera job dies whenever it tries to run due to "Incorrect syntax near 'day'".  The command for the job is as follows:

AP_MEMBERSHIP_UPDATE @i_memb_org = 1, @start_dt = '2005-09-01 00:00:00.000', @end_dt = dateadd(day,-1,convert(varchar,getdate(),112))

Any ideas?  Everything seems correct, but apparently...not?

Thank you for your assistance.

Obligatory Trivia Biscuit:  Just 1,000 words make up 90% of all writing.

Parents
  • You can’t put a function in a procedure call like that.  It has to be a value or a single variable.  You can declare the var like this:

     

    DECLARE @my_end_dt datetime

    SET @my_end_dt = (day,-1,convert(varchar,getdate(),112))

    EXEC AP_MEMBERSHIP_UPDATE @i_memb_org = 1, @start_dt = '2005-09-01 00:00:00.000', @end_dt = @my_end_dt

     

    Michael

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Matt Gonzales
    Sent: Thursday, June 03, 2010 3:50 PM
    To: Michael Reisman
    Subject: [Tessitura Technical Forum] Death and Syntaxes

     

    Fellow Tessiturians,

    My Membership Update Opera job dies whenever it tries to run due to "Incorrect syntax near 'day'".  The command for the job is as follows:

    AP_MEMBERSHIP_UPDATE @i_memb_org = 1, @start_dt = '2005-09-01 00:00:00.000', @end_dt = dateadd(day,-1,convert(varchar,getdate(),112))

    Any ideas?  Everything seems correct, but apparently...not?

    Thank you for your assistance.

    Obligatory Trivia Biscuit:  Just 1,000 words make up 90% of all writing.




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!

Reply
  • You can’t put a function in a procedure call like that.  It has to be a value or a single variable.  You can declare the var like this:

     

    DECLARE @my_end_dt datetime

    SET @my_end_dt = (day,-1,convert(varchar,getdate(),112))

    EXEC AP_MEMBERSHIP_UPDATE @i_memb_org = 1, @start_dt = '2005-09-01 00:00:00.000', @end_dt = @my_end_dt

     

    Michael

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Matt Gonzales
    Sent: Thursday, June 03, 2010 3:50 PM
    To: Michael Reisman
    Subject: [Tessitura Technical Forum] Death and Syntaxes

     

    Fellow Tessiturians,

    My Membership Update Opera job dies whenever it tries to run due to "Incorrect syntax near 'day'".  The command for the job is as follows:

    AP_MEMBERSHIP_UPDATE @i_memb_org = 1, @start_dt = '2005-09-01 00:00:00.000', @end_dt = dateadd(day,-1,convert(varchar,getdate(),112))

    Any ideas?  Everything seems correct, but apparently...not?

    Thank you for your assistance.

    Obligatory Trivia Biscuit:  Just 1,000 words make up 90% of all writing.




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!

Children
No Data