Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATETIME ERRORS

Status
Not open for further replies.

VBXL

Programmer
Joined
Jul 10, 2001
Messages
198
Location
GB
Hi,

has anybody ever had any problems when passing a date & time from VB to SQL 2000 if the teh column is set up as DATETIME.

i.e

VB SQL

a as DATE storedate as DATETIME
b as TIME

INSERT a&b into storedate


Cheers

Xplain


 
Try using a stored procedure, which takes a datetime parameter, instead of hand rolling the SQL (VB is probably converting the datetime to a string, and SQL converting it back to datetime - a recipe for disaster). Assuming your using ADO, create a command object in VB, with the added parameter (or if you're really lazy like me use the VB data environment).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top