Unwanted format in Datetime parameter (Stored procedure)

1

I built a procedimiento almacenado that has two parameters type date . The problem is that these dates come to me with the format

  

NameMes Day Year Time: Minute AM

for example if I send you the date '2017-02-05' comes to the procedure as Feb 05 2017 12:00AM .

What I need is to convert that date into a yyyyMMdd format; I tried with CONVERT in the following way:

Convert(datetime, fecha, 112)

Without any result.

It should be mentioned that the function FORMAT is not supported by the SQL version of the server ( SQLServer 2008 )

Any information is appreciated

    
asked by Paulo Urbano Rivera 15.03.2018 в 16:15
source

1 answer

0

Finally I solved the sending of the parameters from my code in C# sending only the date in this way

DateTime.Parse(item.Start.ToString()).Date)

The only thing that comes to my mind about why it does not work with any conversion is the version I'm using in SQL but honestly I'm not convinced by this argument.

Thankful for the provision!

    
answered by 20.07.2018 / 16:34
source