Jump to content

DateTime Value--> Problem in MySQL

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Dreamcatcher

Dreamcatcher

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
Hi all,

While i was inserting some values at my tables in a mysql server i notice that the value of the datetime field was 0000-00-00 although i have put value (for example 2009-09-10)...Any ideas???:confused:

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,298 posts
don't you need a time as well for the datetime field? try "yyyy-mm-dd hh:mm:ss"
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
Dreamcatcher

Dreamcatcher

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
aha i see...thanks for the advice dude...:)

#4
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,298 posts
cause there is a date type, a time type and a datetime type...
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#5
Dreamcatcher

Dreamcatcher

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
aha i see now...with alter commands i change this value from DATETIME to DATE ( because in the specific i need only the Date ) and i works fine... thanks for the advice...


Now i have another question...Can I modify the value of certain column without changing or erasing the other columns?

Edited by Dreamcatcher, 26 April 2010 - 02:21 AM.
New addition


#6
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,298 posts
the update clause does this in this format:
UPDATE table SET column='value', col2='val2' WHERE id='x'

__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#7
Dreamcatcher

Dreamcatcher

    Learning Programmer

  • Members
  • PipPipPip
  • 39 posts
Super thanks alot dude...^^