Date into VarChar Field

  • Hi

    I am trying to insert a date into a table with a varchar data type so it will show in a format of 03/03/2010, however when inserting the value it is displayed as Mar 3 2011. I know I could change the field type to DateTime but other non datetime values will be entered into this field also.

    An example of the code being used is below:

    UPDATEa

    SET

    a.ConfiguredValue = CONVERT(VARCHAR(8),GETDATE(),112)

    FROMdbo.SSIS_Configurations a

    WHEREConfigurationID = 2

    Anyone have any ideas?

    Thanks

  • try: convert(char(10),getdate(),101)

    The probability of survival is inversely proportional to the angle of arrival.

  • Hey

    Thanks, it worked!

Viewing 3 posts - 1 through 2 (of 2 total)

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