Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8853155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:34:45+00:00 2026-06-14T13:34:45+00:00

I am using the INSERT statement below to insert NOW into a datetime field

  • 0

I am using the INSERT statement below to insert NOW into a datetime field in a SQL dbase

<%
 varAlert = request.querystring("alertID")
 varInspector = session("stUserid")
 varDateRead = NOW 

dim sqlalerts

Set con = Server.CreateObject("ADODB.Connection")
    con.Open MM_inspections_STRING

sqlalerts = "INSERT INTO dbo.tbl_AlertsRead (alertID, inspectorID, dateread) VALUES ('"  & varAlert  & "' ,'"  & varInspector  & "','"  & varDateRead & "')"
con.Execute sqlalerts

    con.Close
    Set con = Nothing

%>

but it’s returning :

Microsoft OLE DB Provider for ODBC Drivers error ‘80040e07’

[Microsoft][SQL Server Native Client 10.0][SQL Server]The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

/html/admin/inspectorsAlertView.asp, line 25

line 25 is the execute statement, am at a loss, NOW returns a valid datetime, and the field ‘dateread’ is definitely a datetime field, and the above INSERT has worked dozens of times without a problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:34:50+00:00Added an answer on June 14, 2026 at 1:34 pm

    Today is 13 November – in UK that would be written as 13/11/2012 but in US it would be 11/13/2012. i think you are inserting the date in the wrong format – which will mean that you are trying to use the 13th month.

    I suspect that this worked before because your dates would have been valid, but incorrect values stored in your database. Check your database for previously inserted values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i insert multiple values in a sql table using single statement. Doing
I am using the below SP to return the value of Generated Insert statement
I am attempting to insert many records using T-SQL's MERGE statement, but my query
I'm using code similar to the one below to insert into a mysql DB
I get an EXC_BAD_ACCESS on the below insert statement using FMDB executeUpdate. It occurs
I've verified all variables below and am now attempting to insert them into my
I am using simple insert statement to insert value to CLOB varaible, anyway i
I am using mysqli_stmt_bind_param() to create an INSERT statement. For some reason I am
I'm using INSERT INTO to copy rows of data from one table to another:
So I'm trying to do a simple insert using Linq but i'm running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.