sábado, 6 de junho de 2009

The search for the right date time format

I was working at this thursday in a friend's project, at my job, and my boss asked us if there was any format of data that Oracle and SQL Server accept at their database date field.
After a little search we find nothing and tought about ask a common friend of us, that really knows a lot of DB, but he didn't remind of anything that we could use, so we decided to ask for it from the DB Admin at my job, and bingo he found something....
He discovered that variations of the form dd-MMM-yyyy should work fine in both applications, that saved us =D....
Some samples:
02-feb-98, 02-FEB-1998, 02-Feb-1998.
Why this saved us? Because it prevent us from code a lot in the project to distinct the databases and do the convert of entry data for each single database application that our application connects to, really a pain in the ass XD....
Hope this little tip could save some of mine readers too =D.

Cheers...

Um comentário:

Fábio disse...

oi, Navarro

Achei o seu blog, é uma iniciativa muito bacana, especialmente que você tem mantido em inglês em português.

Em particular esta dica de SQL é bem útil - sempre que eu fico alguns meses sem mexer com BD esqueço e tenho que procurar de novo.

[]s