Saturday, February 25, 2012

Only Date

Hey,

how can i only save the date in the SQL server? there is are only TimeDate and SmallDateTime Types, both save the date as mm-dd-yyyy hh:mm:ss
i only need the need. and not the time.

ThanxSorry. If you want to save a date as a date, you gotta take that time part as well.

You could save it as a varchar, but I would advise against it...|||You can save the date and time (with time always being 0:00:00), and then just decide to show only the date when formatting the value from the database.|||In fact, to take this a step further:

When inserting a date, if you specify no time value, the time will default to 0:00:00.

No comments:

Post a Comment