Date Functions

Results 1 to 2 of 2

Thread: Date Functions

  1. #1
    Join Date
    Dec 1969

    Default Date Functions

    Hi<BR><BR>I was running a query against a DB by passing in a date <BR>mydate = FormatDateTime(myDate, 2). <BR><BR>The server short date format was as follows<BR>M/d/yyyy.<BR><BR>However, when I moved the code to another server, the report failed for the following reasons:<BR>the DB is expecting format M/d/yyyy. On the original server the short date format was of this type, however the new server&#039;s<BR>short date format is MM/dd/yyyy...<BR><BR>rather than changing the server date format, is there<BR>a way that I can format the date to be of type m/d/yyyy so that I do not have to depend on the server short date format?<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default You *could* change LCID

    Session.LCID = &hHHHH<BR><BR>Choose the same LCID on the second server as is used on the first.<BR><BR>However, the right LONG TERM solution is to *always* use ISO date format, which is<BR> yyyy-mm-dd<BR>such as<BR> 2002-07-25<BR><BR>And there&#039;s a nice article on about how to do this. It was published in February 2002.<BR><BR>**************<BR><BR>I really am curious. What database are you using that would *care* whether you gave it<BR> 07/04/2002 (MM/dd/yyyy)<BR>instead of<BR> 7/4/2002 (M/d/yyyy)<BR>???<BR><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