Results 1 to 5 of 5

Thread: DateTime Type in SQL

  1. #1
    Carl Guest

    DateTime Type in SQL

    I am running into a problem where we cannot use DateTime in SQL.

    I have a field that I have called Date_Created and have set it to data type datetime. The field in auto populated on the page with the year and is Read Only. When you add the record nothing gets added. If I chance the field to char or nvarchar the record will be added with the date. But I want to use datetime.

    Any ideas what could be causing this.

    Thanks, Carl

  2. #2
    Frank Kwong Guest

    DateTime Type in SQL (reply)

    what you mean by "auto populated" ?
    use the MS-SQL Northwind Employee table which has a datetime field as an example and post your code to illustrate your problem concerning datetime.


    ------------
    Carl at 9/24/01 12:18:13 PM

    I am running into a problem where we cannot use DateTime in SQL.

    I have a field that I have called Date_Created and have set it to data type datetime. The field in auto populated on the page with the year and is Read Only. When you add the record nothing gets added. If I chance the field to char or nvarchar the record will be added with the date. But I want to use datetime.

    Any ideas what could be causing this.

    Thanks, Carl

  3. #3
    Carl Guest

    DateTime Type in SQL (reply)

    This is the code that I am using. If I make field number 5 a datetime nothing gets written to the record. If I make it a varchar it works.

    <%
    Set AER1DB = Server.CreateObject(&#34;ASP.db&#34
    AER1DB.dbUnit = 101
    ButtonCheck = Request(&#34;aspDBEditBut_101&#34
    AER1DB.dbDSN = &#34;DSN=XXXXX; UID=XX; PWD=&#34;
    AER1DB.dbSQL = &#34;SELECT * FROM ee_email&#34;
    AER1DB.dbMode = &#34;Both&#34;
    AER1DB.dbNavigation = &#34;Top&#34;
    AER1DB.dbNavigationIcon = &#34;Std&#34;
    AER1DB.dbButtonsOnOff=&#34;EditCancelOff,FilterDro pOff,EditDropOff&#34;
    AER1DB.dbStartUp = &#34;EditAdd&#34;
    AER1DB.dbEditHeader=false
    AER1DB.dbImageDir = &#34;../allied/images/&#34;
    AER1DB.dbNavigationItem = &#34;Add&#34;
    AER1DB.dbColor = &#34;CCCCCC,FFFFFF,04433A,Black,999999,,,,Black&#3 4;
    AER1DB.dbEditParams = _
    &#34;TableName=ee_email,BookMarkFlds=0,TableTag=Bo rder=1&#34;
    AER1DB.dbEditFlds = &#34;1,2,3,4,5[timestamp(mm/dd/yy)]&#34;
    AER1DB.dbEditAddROFlds = &#34;5&#34;
    AER1DB.dbButtonAnchor=false
    AER1DB.ASPdb
    %>

    Carl

    ------------
    Frank Kwong at 9/24/01 12:58:01 PM

    what you mean by &#34;auto populated&#34; ?
    use the MS-SQL Northwind Employee table which has a datetime field as an example and post your code to illustrate your problem concerning datetime.


    ------------
    Carl at 9/24/01 12:18:13 PM

    I am running into a problem where we cannot use DateTime in SQL.

    I have a field that I have called Date_Created and have set it to data type datetime. The field in auto populated on the page with the year and is Read Only. When you add the record nothing gets added. If I chance the field to char or nvarchar the record will be added with the date. But I want to use datetime.

    Any ideas what could be causing this.

    Thanks, Carl

  4. #4
    Carl Guest

    DateTime Type in SQL (reply)

    This is the code that I am using. If I make field number 5 a datetime nothing gets written to the record. If I make it a varchar it works.

    <%
    Set AER1DB = Server.CreateObject(&#34;ASP.db&#34
    AER1DB.dbUnit = 101
    ButtonCheck = Request(&#34;aspDBEditBut_101&#34
    AER1DB.dbDSN = &#34;DSN=XXXXX; UID=XX; PWD=&#34;
    AER1DB.dbSQL = &#34;SELECT * FROM ee_email&#34;
    AER1DB.dbMode = &#34;Both&#34;
    AER1DB.dbNavigation = &#34;Top&#34;
    AER1DB.dbNavigationIcon = &#34;Std&#34;
    AER1DB.dbButtonsOnOff=&#34;EditCancelOff,FilterDro pOff,EditDropOff&#34;
    AER1DB.dbStartUp = &#34;EditAdd&#34;
    AER1DB.dbEditHeader=false
    AER1DB.dbImageDir = &#34;../allied/images/&#34;
    AER1DB.dbNavigationItem = &#34;Add&#34;
    AER1DB.dbColor = &#34;CCCCCC,FFFFFF,04433A,Black,999999,,,,Black&#3 4;
    AER1DB.dbEditParams = _
    &#34;TableName=ee_email,BookMarkFlds=0,TableTag=Bo rder=1&#34;
    AER1DB.dbEditFlds = &#34;1,2,3,4,5[timestamp(mm/dd/yy)]&#34;
    AER1DB.dbEditAddROFlds = &#34;5&#34;
    AER1DB.dbButtonAnchor=false
    AER1DB.ASPdb
    %>

    Carl

    ------------
    Frank Kwong at 9/24/01 12:58:01 PM

    what you mean by &#34;auto populated&#34; ?
    use the MS-SQL Northwind Employee table which has a datetime field as an example and post your code to illustrate your problem concerning datetime.


    ------------
    Carl at 9/24/01 12:18:13 PM

    I am running into a problem where we cannot use DateTime in SQL.

    I have a field that I have called Date_Created and have set it to data type datetime. The field in auto populated on the page with the year and is Read Only. When you add the record nothing gets added. If I chance the field to char or nvarchar the record will be added with the date. But I want to use datetime.

    Any ideas what could be causing this.

    Thanks, Carl

  5. #5
    Frank Kwong Guest

    DateTime Type in SQL (reply)

    If you need help, you have to illustrate your problem using public sample DBs. It is not likely that anybody can look at your own code an tell you what&#39;s wrong with it - even if you are paying of the service.



    ------------
    Carl at 9/24/01 6:07:04 PM

    This is the code that I am using. If I make field number 5 a datetime nothing gets written to the record. If I make it a varchar it works.

    <%
    Set AER1DB = Server.CreateObject(&#34;ASP.db&#34
    AER1DB.dbUnit = 101
    ButtonCheck = Request(&#34;aspDBEditBut_101&#34
    AER1DB.dbDSN = &#34;DSN=XXXXX; UID=XX; PWD=&#34;
    AER1DB.dbSQL = &#34;SELECT * FROM ee_email&#34;
    AER1DB.dbMode = &#34;Both&#34;
    AER1DB.dbNavigation = &#34;Top&#34;
    AER1DB.dbNavigationIcon = &#34;Std&#34;
    AER1DB.dbButtonsOnOff=&#34;EditCancelOff,FilterDro pOff,EditDropOff&#34;
    AER1DB.dbStartUp = &#34;EditAdd&#34;
    AER1DB.dbEditHeader=false
    AER1DB.dbImageDir = &#34;../allied/images/&#34;
    AER1DB.dbNavigationItem = &#34;Add&#34;
    AER1DB.dbColor = &#34;CCCCCC,FFFFFF,04433A,Black,999999,,,,Black&#3 4;
    AER1DB.dbEditParams = _
    &#34;TableName=ee_email,BookMarkFlds=0,TableTag=Bo rder=1&#34;
    AER1DB.dbEditFlds = &#34;1,2,3,4,5[timestamp(mm/dd/yy)]&#34;
    AER1DB.dbEditAddROFlds = &#34;5&#34;
    AER1DB.dbButtonAnchor=false
    AER1DB.ASPdb
    %>

    Carl

    ------------
    Frank Kwong at 9/24/01 12:58:01 PM

    what you mean by &#34;auto populated&#34; ?
    use the MS-SQL Northwind Employee table which has a datetime field as an example and post your code to illustrate your problem concerning datetime.


    ------------
    Carl at 9/24/01 12:18:13 PM

    I am running into a problem where we cannot use DateTime in SQL.

    I have a field that I have called Date_Created and have set it to data type datetime. The field in auto populated on the page with the year and is Read Only. When you add the record nothing gets added. If I chance the field to char or nvarchar the record will be added with the date. But I want to use datetime.

    Any ideas what could be causing this.

    Thanks, Carl

Posting Permissions

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