SQL Date Format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chandru8
    New Member
    • Sep 2007
    • 145

    SQL Date Format

    hi to all
    i am using vb6.0 and msaccess 2003

    iam inserting date like the query mentioned below
    strSql = "Insert into table1 values (#" & Date & "# )"

    the problem is ..,

    for the 1ST date if april it inserted like 04/01/2008

    so i changed the properties in the msaccess table .After that also its saving like that only i thought the msaccess took the date format as mm/dd/yyyy

    but after 10 th date of april

    its inserting like 10/04/2008

    i dont know what to do

    can any one help in this .


    its urgent

    thanks in advance
  • balame2004
    New Member
    • Mar 2008
    • 142

    #2
    Originally posted by chandru8
    hi to all
    i am using vb6.0 and msaccess 2003

    iam inserting date like the query mentioned below
    strSql = "Insert into table1 values (#" & Date & "# )"

    the problem is ..,

    for the 1ST date if april it inserted like 04/01/2008

    so i changed the properties in the msaccess table .After that also its saving like that only i thought the msaccess took the date format as mm/dd/yyyy

    but after 10 th date of april

    its inserting like 10/04/2008

    i dont know what to do

    can any one help in this .


    its urgent

    thanks in advance
    Hi,

    Database always allows us to eneter date in the US format[MM/DD/YYYY]. Don't use indian datetime format.

    Cheers,
    Balaji U

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32656

      #3
      Please remember to provide a meaningful Title for any threads started (Please Use Appropriate Titles for New Threads!). This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

      ADMIN.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32656

        #4
        See Literal DateTimes and Their Delimiters (#) for why your current code is not working. It is all explained in there.

        If you still have difficulty after reading that post back in here and we can try to explain further.

        Comment

        Working...