Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Insert date into microsoft access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-01-04, 08:01
gop373 gop373 is offline
Registered User
 
Join Date: Aug 2004
Posts: 77
Insert date into microsoft access

I want to insert date into table name AAA. Table AAA coloum name dat the type of this column date/time m/d/yyyy. Ex. 10/1/2004

dim todaysDate,t,testdate
todaysDate=now()
testdate=FormatDateTime(todaysDate,2)
sql="insert into AAA(dat,price) values('"&testdate&"',"&cp1&")"

But when I check in table AAA the date is like this 1/10/2004 . The form that i want to insert is m/d/yyyy
Reply With Quote
  #2 (permalink)  
Old 10-01-04, 08:12
gop373 gop373 is offline
Registered User
 
Join Date: Aug 2004
Posts: 77
One more thing. I don't want to use Cstr() because I need to compare date.

sql="select Max(price) as maxprice from Microsoft where dat=date()"
Reply With Quote
  #3 (permalink)  
Old 10-04-04, 20:20
rokslide rokslide is offline
Coffee Minion
 
Join Date: Nov 2003
Location: Sydney
Posts: 1,515
Quote:
But when I check in table AAA the date is like this 1/10/2004
what are you using the check the date inthe table?

It is likely that your regional settings are causing you problems and that the stored date is correct it is just displaying in a different format. Do a check with a different date 12/31/2004 for example that can only be in m/d/yyyy and see what happens....
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On