chimchillas chimchillas - 1 year ago 74
SQL Question

Dates Being sent to SQL in many different formats, how do i handle this?

I I'm busy with editing my stored procedures for Reports i created a while back.
I encountered a problem where the parameters being sent to the stored procedures comes in all kinds of funky formats from multiple computers.

Some of the formats i have encountered has been






I desperately need a way to handle all these different formats.
the '31012017' gives me a input error so it doesnt even want to reach my Converter so i made the input parameter a VARCHAR(15) to take all kinds of inputs.

Answer Source

The best possible fix i found was the following(works for almost all formats)

This way it picks up which format whatever PC you are using is using and sends a standardized format to SQL

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download