Date problems

Results 1 to 2 of 2

Thread: Date problems

  1. #1
    Join Date
    Dec 1969

    Default Date problems

    Hi - I have written an asp site which uses alot of sql and its suppoesed to display items with a date greater than todays date. I&#039;m from SA so I have set my date format to dd/mm/yyyy in access + the server&#039;s dates are also set to display dd/mm/yyyy but whenever the day starts with a 0 ie the first ten days of the month, numerous sql tests have revealed that if there&#039;s a one digit day the sql engine treats that as the month so I am getting very erroneous results. How do setup these dates and my sql query to get consistent results.<BR>Thanks

  2. #2
    Rhino Guest

    Default RE: Date problems

    What I do to get around that is to always format the date into a non ambiguous one before sending it to the Sql<BR><BR>E.g.<BR><BR>MySql = "Update MyTable SET MyTable.MyDate = #" & FormatDateTime(Date(),1) & "#"<BR><BR>This will evaluate as <BR>Update MyTable SET MyTable.MyDate = #01 August 2001#<BR>Which Access will treat correctly no matter what your server settings are.<BR>

Posting Permissions

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