date in database row is YYYY/MM/DD but in asp RETURNS DD/MM/YYYY

  • My question is not about ASP Pages is because a system was using Access database and when i past it to sql database i get in my asp application the date format like mm/dd/yyyy but i get 28/12/2009(month 28?) in the sql database the value is 2009/12/28, well the result i need is mm/dd/yyyy like 12/28/2009

    Note: When i get the values from the access database i get 12/28/2009 that its ok

    Please Help! =(

  • Sounds like you need to check the regional settings on the client. This isn't a SQL Server issue.

  • You could try to force the output from SQL Server to U.S. standard format using CONVERT(CHAR(10),YourDateValue,101).

    Edit: ... but this won't be a date format anymore. But it's possible that your app will do an implicit conversion back to a date format, if required.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • The original post seems confusing. Are you viewing the data in an Access front end or are you viewing it via an a ASP.NET page? The relationship between Access, ASP.NET and SQLServer isn't clear to me.

    If you're linking an Access front end to SQLServer, what is the format of the dates when you open the linked table directly in Access?

    If you're viewing it via an ASP.NET page, here's one way to format the value.

    #Eval("PhoneTemporaryInformationExpirationDate", "{0:dddd, MMMM d, yyyy}")

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

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