#1
  1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2008
    Posts
    53
    Rep Power
    11

    Converting date problem


    In my database, I have a date of birth column, data type smalldatetime, stored DD/MM/YYYY.

    In a stored procedure I am running, i am selecting it to show it on a webpage but would like the format to be MM/DD/YYYY.

    I have looked on google but cant get it to work so wondered if anybody could tell me how to do it, thanks.
  2. #2
  3. No Profile Picture
    q97
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Apr 2005
    Location
    Brisvegas
    Posts
    439
    Rep Power
    116
    I wish someone would sticky my response...this question pops up about once or twice a week.

    Search my other posts for: SET DATE FORMAT

    I've written it all before, not doing it again.
  4. #3
  5. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2009
    Posts
    39
    Rep Power
    15

    Re:Converting table name


    Hi,

    I hope that the below query will be useful for you

    Code:
    select CONVERT(char,time,103) from test1

    Note:

    Time is a column name

    Test1 is a table name






    Originally Posted by apachehelp
    In my database, I have a date of birth column, data type smalldatetime, stored DD/MM/YYYY.

    In a stored procedure I am running, i am selecting it to show it on a webpage but would like the format to be MM/DD/YYYY.

    I have looked on google but cant get it to work so wondered if anybody could tell me how to do it, thanks.
  6. #4
  7. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2009
    Posts
    39
    Rep Power
    15

    Re:Converting table name


    Hi,

    I hope that the below query will be useful for you

    Code:
    select CONVERT(char,time,103) from test1

    Note:

    Time is a column name

    Test1 is a table name






    Originally Posted by apachehelp
    In my database, I have a date of birth column, data type smalldatetime, stored DD/MM/YYYY.

    In a stored procedure I am running, i am selecting it to show it on a webpage but would like the format to be MM/DD/YYYY.

    I have looked on google but cant get it to work so wondered if anybody could tell me how to do it, thanks.

Similar Threads

  1. Date format problem in asp and Access database
    By ychousa in forum ASP Development
    Replies: 4
    Last Post: June 3rd, 2006, 04:08 AM
  2. Problem Converting Date Variables
    By cjreynolds in forum ASP Development
    Replies: 11
    Last Post: September 28th, 2005, 05:08 PM
  3. Date format Problem
    By ellen in forum ASP Development
    Replies: 21
    Last Post: September 19th, 2005, 03:38 AM
  4. Problem with date formats
    By Matt71 in forum Microsoft SQL Server
    Replies: 2
    Last Post: June 24th, 2004, 02:51 AM

IMN logo majestic logo threadwatch logo seochat tools logo