Datetime / Date

  • Hi again,

    I have a field which is a datetime vaule and i would to show it ion a different format....

    2009-09-01 00:00:00.000 is how it appears now

    010909 is how i would like it to appear..... any ideas??

    Cheers guys!!

    Sam Marsden

  • sam.marsden (9/1/2009)


    Hi again,

    I have a field which is a datetime vaule and i would to show it ion a different format....

    2009-09-01 00:00:00.000 is how it appears now

    010909 is how i would like it to appear..... any ideas??

    Cheers guys!!

    First, why?

  • I need to have the date in that format to save in a Csv file that will be imported into sage later. Safe is being really funny about the formats of things...

    Sam Marsden

  • select replace(convert(varchar(8),getdate(),5),'-','');

    Try the above.

  • Thanks that looks great - i'll give it a try later and let you know how it goes.

    Sam Marsden

  • Works like a dream,

    Thanks Lynn

    Sam Marsden

  • One and too

    select replace(convert(varchar(8),cast('2009-09-01 00:00:00.000'as datetime),5),'-','');

    Thanks Lynn

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

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