VB->SQL: Date Format Problem.
From: CJM (cjmnews04_at_newsgroups.nospam)
Date: 11/26/04
- Next message: Tibor Karaszi: "Re: VB->SQL: Date format"
- Previous message: Tibor Karaszi: "Re: problem with almost 2-3 GB records in a table"
- Next in thread: David Portas: "RE: VB->SQL: Date Format Problem."
- Reply: David Portas: "RE: VB->SQL: Date Format Problem."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 26 Nov 2004 10:09:40 -0000
[Apologies for earlier post - twitchy trigger finger!]
I have a VB6 application that links to an SQL Server 2000 DB (via ADO)
I recently had to change it to add a date field to one of the features,
which although it worked on my development machine, it wouldnt work on the
live system. I normally format my dates for SQL as follows: YYYY-MM-DD, and
this normally works for me. This also worked on my development machine for
this project, but wasnt accepted by the live server. The error generated
was:
Error 3591 - The conversion of a char data type to a datetime data type
resulted in an out-of-range datetime value.
After further investigation, it appears that the SQL code that is called
from the VB app would work fine if run through Query Analyzer on the live
machine.
After a bit of fiddling, I figured out that YYYYMMDD would work on both
servers, so I have a solution.
I imagine that this is something to do with regional settings or
installatioin settings for the different intances of SQL server but beyond
that I am clueless.
Is there anything I can do to remedy this?
Thanks
Chris
- Next message: Tibor Karaszi: "Re: VB->SQL: Date format"
- Previous message: Tibor Karaszi: "Re: problem with almost 2-3 GB records in a table"
- Next in thread: David Portas: "RE: VB->SQL: Date Format Problem."
- Reply: David Portas: "RE: VB->SQL: Date Format Problem."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|