I have a system that takes a view and allows a user to build an adhoc query but it relies on the data type of the field in order to provide the proper options (before, after, between, etc)
I have a date time field that I am using in a view, when I output the field in the system it looks like you'd expect a date time field to be formatted yyyy-mm-dd hh:mm:ss
What I want to be displayed is mm/dd/yyyy
so I use
convert(varchar,myDate,101)
which works great but now my end system doesn't give me date options, it gives me varchar options (does not contain, begins with, etc)
So I try
cast(convert(varchar,myDate,101) as date)
I get the proper options again but that changes the format back to yyyy-mm-dd
My question is, how can I format the date to be mm/dd/yyyy
and still maintain the date data type?