Skip to Content
avatar image
Former Member

Problem with date value while passing as a parameter to stored procedure

Hi,

    When i am passing date value as a parameter to stored procedure it is taking date in the format of "dd/MM/yyyy".

    But i want to take the date format like "MM/dd/yyyy". I have tried many functions.I am unable to solve.Please help me out with this problem.

Thanks and Regards,

Krishna Sandeep.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Feb 04, 2013 at 12:42 PM

    I always convert input dates to format "YYYY-MM-DD" and pass it as a string. This is SQL Server's native format, and it's always accepted regardless user's locale and regional settings.

    Beni.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Edy Simon

      Hi Edy,

                I have changed my data type of date to NVARCHAR. But i am unable to pass value to record set.How to pass a value to record set? Please help me out..

  • Feb 07, 2013 at 08:25 AM

    Hi Khrisna,

    Can we take a step back ?

    It seems like we are going in circle.

    Tell me if I am wrong :

    1. You would Run SP1. The result of this SP1 is an Object of type Date.

    2. You pass this result into SP2, which also accepts parameters of type Date. - We have cover this and you had succesfully pass the date into the SP2.

    3. SP2 would run in server side.

    4. SP2 should return you a value.

    5. You would use the result of this SP2 either to show to user /  next processing.

    Can you tell me where you want the format to be "MM/dd/yyyy" as in your original question ?

    Regards

    Edy

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 12, 2013 at 03:48 PM

    Hi Krishna,

    If what you say is true, that is strange. Can you tell me which sap version are you using?

    As a work around, I suggest you change your sp2 to accept nvarchar 8 Parameters and pass the yyyyMMdd date format from your program

    Regards,

    Edy

    Add comment
    10|10000 characters needed characters exceeded