Databases & Dates

Results 1 to 5 of 5

Thread: Databases & Dates

  1. #1
    Karen Howie Guest

    Default Databases & Dates

    Hi there,<BR><BR>Sorry to bother you but I&#039;m in a bit of a panic. I&#039;ve built a database driven web site (in very short time!) running with ASPs and Access 97 on an NT machine with IIS4.0 installed. It was built on our developmental server and today I was to move it over to the actual server the site is on. It all moved over fine except I&#039;m now having date problems when I was having none before. As far as I can see the new server is set up pretty much the same as the developmental one and I&#039;ve checked the locales and they are the same.<BR><BR>The asps which use dates are giving me errors like this:<BR><BR>[Microsoft][ODBC Microsoft Access 97 Driver] Syntax error in date in query expression &#039;(End_Date &#060; #Tuesday, May 29, 2001#)&#039;.<BR><BR>which I find really bizarre - seems to be more like an SQL error to me. I&#039;ve also noticed that it doesn&#039;t like &#039;today()&#039;. I can&#039;t every remember seeing a day of the week in the queries in the developmental server - could this be causing the problem? If so, how do I get rid of them.<BR><BR>Sorry to bother you - please let me know if you need more info.<BR><BR>Cheers<BR><BR>Karen

  2. #2
    Karen Howie Guest

    Default PS: Databases & Dates

    I think it may have something to do with a line of code looking like this:<BR><BR>today = formatDateTime(Date(),vbLongDate)<BR><BR>and I meant Date() in the previous email rather than today() (too many programming languages stuffed in my small brain!)<BR><BR>Cheers<BR><BR>Karen

  3. #3
    Eddie Campbell Guest

    Default RE: PS: Databases & Dates

    Yes, the formatdatetime() function is what is causing the problem. You should only use that for display to the screen. If you are writing the date to the database, just use Date().

  4. #4
    Karen Howie Guest

    Default RE: PS: Databases & Dates

    Thanks for that. It is still bringing the stuff out in US format, but no doubt that will be some configuration problems somewhere. <BR><BR>Thanks again - much appreciated.<BR><BR>Karen

  5. #5
    Eddie Campbell Guest

    Default RE: PS: Databases & Dates

    To get it to display in UK format, put Session.Lcid = 2057 at the top of the page. But beware that access likes to get dates in US format, so you may run into problems when you enter an ambiguous date. To fix this, you can set the Lcid format back to US just before doing an update. (US is 1033).<BR><BR>Good luck

Posting Permissions

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