Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    77

    Unanswered: 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

  2. #2
    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()"

  3. #3
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •