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

how to insert date format into access 2003

chandru8
100+
P: 145
hi to all
iam using vb6.0
can any one correct me

the query which below mentioned is correct

strSql = "Insert into table1 values (#" & Date & "# ,'2')"
Set rs = objCon.Execute(strSql)

or
the date format has to send like a string
strSql = "Insert into table1 values ('" & de & "' ,'2')"
Set rs = objCon.Execute(strSql)
Apr 14 '08 #1
Share this Question
Share on Google+
9 Replies


jeffstl
Expert 100+
P: 432
hi to all
iam using vb6.0
can any one correct me

the query which below mentioned is correct

strSql = "Insert into table1 values (#" & Date & "# ,'2')"
Set rs = objCon.Execute(strSql)

or
the date format has to send like a string
strSql = "Insert into table1 values ('" & de & "' ,'2')"
Set rs = objCon.Execute(strSql)
I am pretty sure for Access the correct format is

Expand|Select|Wrap|Line Numbers
  1. strSql = "Insert into table1 values (#" & Date & "# ,'2')"
  2.  Set rs = objCon.Execute(strSql)
  3.  
If you get an error using that please post, but I think that is correct.
Apr 14 '08 #2

chandru8
100+
P: 145
am not getting error i need to use this access in multi user format so the date format is changing according to the reginal setting is there any way to generalise the date format
Apr 15 '08 #3

lotus18
100+
P: 866
am not getting error i need to use this access in multi user format so the date format is changing according to the reginal setting is there any way to generalise the date format
Try the format function.

Rey Sean
Apr 15 '08 #4

chandru8
100+
P: 145
i tried that also up 01/04/2008(dd/mm/yyyy) to 12/04/2008(dd/mm/yyyy)
its saving in the access as 04/01/2008 ,04/02/2008 .....04/12/2008

after 12
1st saving 13 th date as
13/04/2008
14/04/2008
.
.
.
31/04/2008

i used format function

and also
de = Format(DateSerial(Year(Calendar1.Value), Month(Calendar1.Value), Day(Calendar1.Value)), "mm/dd/YYYY")
strSql = "Insert into table3 values (#" & de & "#)"
Set rs = objCon.Execute(strSql)


is there any way to specify the general format in msaccess 2003

thanks
Apr 15 '08 #5

lotus18
100+
P: 866
So you are using 'Short Date' format in your access?

Rey Sean
Apr 15 '08 #6

chandru8
100+
P: 145
i tried to change the format what my regional settings have
but the value is swaping up to 12
Apr 15 '08 #7

Tenneyson
P: 17
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2. Dim mydate
  3.     mydate = Format(Date, "DD-MM-YYYY")
  4.     MsgBox "" & mydate
  5. End Sub
  6.  
  7.  

try to play around with this in your VB 6 for your date format
Apr 15 '08 #8

chandru8
100+
P: 145
Have You Understand My Problem

The Problem Is Not With Vb6.0 And I Know About The Format Statement

The Problem Is
How To Store Our Desired Format Without The Regional Settings Date Format
Apr 15 '08 #9

chandru8
100+
P: 145
Any One Correct Me
Can I Declare That Date Data Type As Text

If I Declared As Text It Will Satisfies All The Calculation What We Do For The Date



Its Urgent Iam Doing This For Two Days
Thanks
Apr 15 '08 #10

Post your reply

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