|
-
August 21st, 2001, 02:28 AM
#1
Dates In VB
Hello
I have a problem with dates in vb;
I have an application that querries and updates dates fields in an Access DataBase. I work with Windows in french. When I send an update request on a date field, the day and the month are sometimes swapped. Any Idea?
Regards
-
August 21st, 2001, 03:04 AM
#2
Re: Dates In VB
Didn't u try the format command ?
Did u use different machines in which Date formats r different?
Check for the above and do some chanes necessary & see.
Good Luck
Srinika
If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it 
-
August 21st, 2001, 03:25 AM
#3
Re: Dates In VB
If you are using SQL statement like "Update SomeTable where Datefield=datevalue' always specify datevalue in mm/dd/yyyy format (Access and MS Sql Server) .
For Ex: "update mytable set dtfield='" & format(date,"mm/dd/yyyy") & "' where dtfield='" & format(somedate,"mm/dd/yyyy") & "'"
If you are using Recordset.Update method use default VB date format (which is also system's date format)
hope this works
-
August 21st, 2001, 04:21 AM
#4
Re: Dates In VB
I've found a solution!!!
When I was using the following syntax, the used Date Format was the International One (mm/dd/yy);
"UPDATE t_Dates set Date_Field = date WHERE Date_Field = AnotherDate"
So, with the following code, the Date Format is the System's one (european in my case);
Qdf = Database.CreateQueryDef ("", "UPDATE t_Dates set Date_Field = date WHERE Date_Field = AnotherDate")
Qdf.Execute
That's It, Thanx.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|