Changing a date format

  • I would like to change the format of a date in SQL so that it is a little bit cleaner whhen querried. At this point, when I query the date, it returns "07/08/2005 00:00:00". I would like for it to show as "07/08/2005". Can I change the format of the date in my database or am I stuck just changing it during my SQL statement? Thanks

  • Statement. Unless you preffer to change the datatype to char(10), which I just wouldn't recommend.

  • Can't you change that at client side ?


    * Noel

  • Would you mind explaining why you wouldn't recommend changing it to char(10). Thanks

  • You lose the use of the date functions associated with the datetime datatype (or you have to reconvert back to be able to use them). Also you might lose the time precision when you actually need it.

    I forgot to mention the classic answer to this one, and as Noeld pointed out : do it client side... let the programmers do their job .

  • Time for me to .... A G R E E

     


    * Noel

  • The problem that I am running into is that we bought our software and don't have access to what the SQL is that is pulled for our forms. In this particular case, the time always shows up as "00:00:00" so it serves no purpose. I am pretty sure, or would like to hope, that when a form prints it queries the view of the actual table. Is there some SQL that I can change on the UPDATE statement so that atleast the view has what I want?

  • I still wouldn't mess with the data just to beautify the data (unless it causes other problems). You can create much bigger problems that way... especially if you don't know the software.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply