.net - How will you process date values stored in varchar fields? -


your user wants report sorted date. report being created using c# , odp.net sort on date column , output not user expected.

upon closer inspection, find date column varchar2 field. values in column stored in dd-mon-yy "01-jan-10" format.

how sorted date?

my answer:

select to_date(fakedatecolumn,'dd-mon-yy') table order to_date(fakedatecolumn,'dd-mon-yy') 

is there available in front-end? suppose datetime.parseexact trick well.

you answer correct. sorting should done @ database level. using datetime.parseexact mean rows need fetched @ client , sorted might not efficient. once results fetched sorted database parse string datetime show formatted in user interface.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -