Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. how to change the date format

how to change the date format

Scheduled Pinned Locked Moved Database
databasehelptutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mon z
    wrote on last edited by
    #1

    i have a date format in 06/01/2008 which datatype is nvarchar(50).how i will change it into 06/jan/2008 format in sql. Plz help me. select log_in_date from test1 out_put 06/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2

    N A 2 Replies Last reply
    0
    • M mon z

      i have a date format in 06/01/2008 which datatype is nvarchar(50).how i will change it into 06/jan/2008 format in sql. Plz help me. select log_in_date from test1 out_put 06/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      mon***z wrote:

      nvarchar(50).

      I am not sure about NVarchar, but if you were using DateTime type, use convert function to change the display format.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

      V 1 Reply Last reply
      0
      • N N a v a n e e t h

        mon***z wrote:

        nvarchar(50).

        I am not sure about NVarchar, but if you were using DateTime type, use convert function to change the display format.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        thanks man for your answer I missed the namespace Messagebox.show("Invalid Data Entry"); ANd the message Messagebox, does not Exists in the Current Context Thanks

        Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za

        1 Reply Last reply
        0
        • M mon z

          i have a date format in 06/01/2008 which datatype is nvarchar(50).how i will change it into 06/jan/2008 format in sql. Plz help me. select log_in_date from test1 out_put 06/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 06/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 07/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 08/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 09/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 10/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 11/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 12/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 13/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 14/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 15/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2008 16/01/2

          A Offline
          A Offline
          Ashfield
          wrote on last edited by
          #4

          Well, a couple of sample dates would have done rather than dozens, but your answer is: Using @a to represent your column declare @a nvarchar(50) set @a = '28/10/2008' set dateformat dmy select convert(varchar,datepart(day,@a)) + '/' + left(datename(month,@a),3) + '/' + convert(varchar,datepart(year,@a)) You need the set dateformat dmy so SQL knows its day month year

          Bob Ashfield Consultants Ltd

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups