Problem with insert dates in SQL

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Problem with insert dates in SQL

    Hi, I have a table with a camp "Fecha" (it is datetime).I
    insert a date in this format: dd/mm/yy (for example
    01/11/2003) but in the table the insert value is 1/1/1900.
    I insert the value using ASP code. What is the problem?

    Thanks and regards.
    Oswaldo Guest

  2. Similar Questions and Discussions

    1. Data Connection Wizard... problem with dates?
      Hi, I don't know if there is some trick to this, but I'm just starting to experiment with data integration in Flash MX 2004 Pro 7.2. I'm using...
    2. Problem with insert dates
      Hi, I have a problem on my CFMX 6.1 server. When I try to insert a date in a access DB it insert not the right date but the right date less one...
    3. Problem with dates
      Has anyone gotten this to work using just SQL hooked to a simple MS Access datasource?
    4. Problem with insert
      I have the following code in an ASP page that is processing a form to create a new user. I keep getting the following error Microsoft JET...
    5. can't insert dates in SQL Server 2000
      Perhaps that's because what you're actually converting is 31 divided by 7 divided by 2003 instead of the string '31/07/2003'. Ray at home --...
  3. #2

    Default Re: Problem with insert dates in SQL

    (1) Is that January 11th, or November 1st? I have no idea, and don't expect
    your software to guess right either. Use an ISO standard date format, e.g.
    2003-11-01 for Access, 20031101 for SQL Server.

    (2) Make sure you are delimiting your dates correctly (sounds like you are
    passing in 1/11/2003 directly, which is 1 divided by 11 divided by 2003, a
    very small number indeed). For SQL Server, use

    INSERT table(dateColumn) VALUES('20031101')

    For Access, use

    INSERT table(dateColumn) VALUES(#2003-11-01#)

    In the future, please show the exact code you are using, and specify the
    database and version. It makes it much easier to spot the problem and
    suggest solutions.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]




    "Oswaldo" <jmendieta@comercio.com.pe> wrote in message
    news:021f01c3b075$c6d25080$a501280a@phx.gbl...
    > Hi, I have a table with a camp "Fecha" (it is datetime).I
    > insert a date in this format: dd/mm/yy (for example
    > 01/11/2003) but in the table the insert value is 1/1/1900.
    > I insert the value using ASP code. What is the problem?
    >
    > Thanks and regards.

    Aaron Bertrand - MVP Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139