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.

  • You want

    dateadd(day,-1,convert(varchar,getdate(),112))

    to be

    dateadd(dd,-1,convert(varchar,getdate(),112))

  • 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!

  • Hi Matt

     

    I think it don’t like you giving it a parameter that isn’t a value.  You can pass it a variable as below – that works

     

    declare @pdate as datetime

    select @pdate = dateadd(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 = @pdate

     

    Moira

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Matt Gonzales
    Sent: 03 June 2010 20:50
    To: Mannas, Moira
    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!


    www.southbankcentre.co.uk

    Ticket Office: 0844 847 9910

    Southbank Centre is a Registered Charity No. 298909

    ______________________________________________________________________

    This message (and files transmitted with it) may contain confidential or copyright information. If you receive it in error, please notify the sender and delete it from your computer.

    _______________________________________________________________________