Results 1 to 5 of 5

Thread: Date

  1. #1
    Join Date
    Jan 2004
    Posts
    17

    Unanswered: Date

    I am using 'dd-mmm-yyyy' format in my app. front end is VB.

    how do i convert default system dateformat to my custom format to display it in front end.

    I cannot change it through front end.

    is there any format function i can specify in query?

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Look up convert function in BOL.
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    Jan 2004
    Location
    Romania - Bucharest
    Posts
    50
    inside SQL Server, the "date" datatype is stored the same, regardless of the user locale.

    It was not clear from your post, bu if you need to convert the date field into a string representation, see the "convert" function in Books Online

  4. #4
    Join Date
    Jan 2004
    Posts
    17

    convert function

    How do i use convert function can u give me an example

    if systemdate format id m/d/yy & i want to convert it to dd-mmm-yyyy how do i do that?

  5. #5
    Join Date
    Jan 2004
    Location
    Romania - Bucharest
    Posts
    50
    From Books Online:

    CONVERT ( data_type [ ( length ) ] , expression [ , style ] )

    Convert (varchar(20), Your_Date, 101) -> mm/dd/yy
    Convert (varchar(20), Your_Date, 102) -> yy.mm.dd
    Convert (varchar(20), Your_Date, 113) -> dd mon yyyy hh:mm:ss:mmm(24h)
    Convert (varchar(20), Your_Date, 114) -> hh:mi:ss:mmm(24h)

    ...

    etc

    See the BOL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •