Link to home
Start Free TrialLog in
Avatar of CraigLazar
CraigLazar

asked on

Date Problem into database

Hi
i am using VB6 srv5 and i am using ado connecting to Access 2002. Now i am trynig to update a date value in a table, i am using an update statement in vb

cn.Execute "UPDATE tblMasterSettings Set GRptBranch = '" & GRptBranch & "',GRptActionDate  = #" & CDate(Format(GRptDate, "DD-MMM-YYYY")) & "#;"

now the date is in the correct format in my variable, however it is swopping th emonth and the day around in the database field from 02-12-2002 to 12-02-2002.
This is driving me nuts

My data type in the database is Date/Time
i ahve tried using the input mask in access, it just keeps swopping the day and the month around

please help

thanx

Craig
ASKER CERTIFIED SOLUTION
Avatar of CraigLazar
CraigLazar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ndastur
ndastur

Just for anyone else that reads this. Access requires the data in US format. So regardless of the local format you should always pass the date using format mm-dd-yyyy
Avatar of DanRollins
CraigLazar, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer