I have a question regarding the datetime format.
I have a field with datatype of datetime, how I can change to format when I retrieve from database from (yyyy-mm-dd hh:mi:ss) to (yyyy-mm-dd)? I have tried the Cast function, cast(mydate as char(10)) but this will change the format to (Mon dd yyyy) where I wanted (yyyy-MM-dd).
Can anyone answer my question??
I have a field with datatype of datetime, how I can change to format when I retrieve from database from (yyyy-mm-dd hh:mi:ss) to (yyyy-mm-dd)? I have tried the Cast function, cast(mydate as char(10)) but this will change the format to (Mon dd yyyy) where I wanted (yyyy-MM-dd).
Can anyone answer my question??