By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 900 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

i had a problem in the date format

chandru8
100+
P: 145
hi to all
i am using vb6.0 and msaccess 2003

iam inserting date like the query mentioned below
strSql = "Insert into table1 values (#" & Date & "# )"

the problem is ..,

for the 1ST date if april it inserted like 04/01/2008

so i changed the properties in the msaccess table .After that also its saving like that only i thought the msaccess took the date format as mm/dd/yyyy

but after 10 th date of april

its inserting like 10/04/2008

i dont know what to do

can any one help in this .


its urgent

thanks in advance
Apr 14 '08 #1
Share this Question
Share on Google+
6 Replies


debasisdas
Expert 5K+
P: 8,127
You need to foramt the date before processing in database.
Apr 14 '08 #2

chandru8
100+
P: 145
i have done that also my sys format is dd/mm/yyyy
up to 12 the format is mm/dd/yyyy
after that it changing like 13/04/2008
Apr 14 '08 #3

chandru8
100+
P: 145
date
1/4/2008
2/4/2008
3/4/2008
4/4/2008
5/4/2008
6/4/2008
7/4/2008
8/4/2008
9/4/2008
10/4/2008
11/4/2008
12/4/2008
4/13/2008
4/14/2008
4/15/2008
4/16/2008
4/17/2008
4/18/2008




iam getting the date like this can any one help me
Apr 14 '08 #4

lotus18
100+
P: 866
date
1/4/2008
2/4/2008
3/4/2008
4/4/2008
5/4/2008
6/4/2008
7/4/2008
8/4/2008
9/4/2008
10/4/2008
11/4/2008
12/4/2008
4/13/2008
4/14/2008
4/15/2008
4/16/2008
4/17/2008
4/18/2008

iam getting the date like this can any one help me
The date format in your access and in your sql statement should be in the same format (mm/dd/yyyy).

Rey Sean
Apr 14 '08 #5

chandru8
100+
P: 145
my sys date format is mm/dd/yyyy
but some of my user machines date format is different i dont know how to use the generalised date format
Apr 14 '08 #6

lotus18
100+
P: 866
my sys date format is mm/dd/yyyy
but some of my user machines date format is different i dont know how to use the generalised date format
There's no problem with that. Just format the date like this:

Expand|Select|Wrap|Line Numbers
  1. strSql = "Insert into table1 (YourFieldName) values (#" & format(Date, "mm/dd/yyyy") & "# )"
  2.  
Rey Sean
Apr 14 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.