Re: formatting date field

From: DTJ (dtj_at_comcast.net)
Date: 05/03/04

  • Next message: DTJ: "Re: formatting date field"
    Date: Mon, 03 May 2004 22:10:00 GMT
    
    

    On Fri, 30 Apr 2004 16:22:01 GMT, "Jarod_24" <jarod_24@hotmail.com>
    wrote:

    >How do i format a DateTime file in a sql-query?
    >
    >I got a sql sentence like this:
    >
    >"SELECT Name, DateRegistered
    > FROM Customer;"
    >
    >The "DateRegistered" field comes out as "2004-05-10T00:00:00.0000000+02:00"
    >I need it as "DD.MM.YYYY".
    >
    >Is there any function that i can use, like "DateFormat" in the sql sentence?

    Look up CONVERT and CAST in Books Online. I use these in queries to
    take dates and format them in standard SQL supported ways, such as
    DD/MM/YYYY. If you require a particular seperator, you may have to
    use DATEPART (?) to extract the Month, Day and Year and concatenate
    them how you want.


  • Next message: DTJ: "Re: formatting date field"
    Loading