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. Date format problem

Date format problem

Scheduled Pinned Locked Moved Database
helpquestion
2 Posts 2 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.
  • P Offline
    P Offline
    Prashant C
    wrote on last edited by
    #1

    I have created one table with DATETIME datafield, but its allowing me to store date only in 'mm/dd/yyyy' format so, how do i change the format of this field to 'dd/mm/yyyy' I hope you understood the problem.... Thanks. :-D Prashant C

    K 1 Reply Last reply
    0
    • P Prashant C

      I have created one table with DATETIME datafield, but its allowing me to store date only in 'mm/dd/yyyy' format so, how do i change the format of this field to 'dd/mm/yyyy' I hope you understood the problem.... Thanks. :-D Prashant C

      K Offline
      K Offline
      Krish KP
      wrote on last edited by
      #2

      Just copy pasting online help .... SET DATEFORMAT Sets the order of the dateparts (month/day/year) for entering datetime or smalldatetime data. Syntax SET DATEFORMAT { format | @format_var } Arguments format | @format_var Is the order of the dateparts. Can be either Unicode or DBCS converted to Unicode. Valid parameters include mdy, dmy, ymd, ydm, myd, and dym. The U.S. English default is mdy. Remarks This setting is used only in the interpretation of character strings as they are converted to date values. It has no effect on the display of date values. The setting of SET DATEFORMAT is set at execute or run time and not at parse time. Permissions SET DATEFORMAT permissions default to all users. Examples This example uses different date formats to handle date strings in different formats. SET DATEFORMAT mdy GO DECLARE @datevar datetime SET @datevar = '12/31/98' SELECT @datevar GO SET DATEFORMAT ydm GO DECLARE @datevar datetime SET @datevar = '98/31/12' SELECT @datevar GO SET DATEFORMAT ymd GO DECLARE @datevar datetime SET @datevar = '98/12/31' SELECT @datevar GO

      Regards KP

      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