Inserting date issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • microjack
    New Member
    • Aug 2007
    • 3

    Inserting date issue

    I’ve finally made the jump from Access to SQL Express but I’m having some difficulty inserting a date using an asp/vbscript page.

    I’ve trawled the web and persisted with trial and error and basically I’m down to 2 outcomes.

    The first…

    Formatting the date before insert, all combination of day month and year using / or - as a separator. The insert works but shows in the table as either 01/01/1900 or some other crazy combination.

    The second…

    Formatting the date as yyyymmdd as recommended up and down the web produces this error

    Microsoft OLE DB Provider for ODBC Drivers (0x80040E57)
    [Microsoft][SQL Native Client][SQL Server]Arithmetic overflow error converting expression to data type datetime.

    I’m very new to SQL so I could be wrong but I’m starting to think this is a SQL configuration issue.

    The SQL column is set to datetime
    The user language (user defined in the connection string) is set to British English although I’ve tried plain English too.

    Any ideas welcome.
    Last edited by microjack; Aug 16 '07, 06:34 PM. Reason: Adding extra information
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    You're right, I think this is a configuration problem. I've been able to insert dates in just about any format. have you tried an unformatted system date like date()?

    Jared

    Comment

    Working...