Re: Date Problems - ASP/SQL

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Fawke101 (guy_at_ANTIbradflack.SPAMcom)
Date: 05/13/04


Date: Thu, 13 May 2004 17:58:00 +0100

OK, at the risk of sounding daft....

How could i incorporate the code needed for YYYYMMDD (behind the scenes)
into the current application.
Basically i need to have the Text box in ASP display the date as DD/MM/YYYY
(and users to enter the date as DD/MM/YYYY) and Enterprise manager
(presumably it will anyway, depending on Locale (UK)) whilst passing the
Data as what you recommend.

Thanks for this, i would have gone on regardless had you not of pointed this
out....
I presume you dont mind helping me implement this?

Thanks so much

-- 
Thanks in advance
Fawke
Please remove ANTI and SPAM
from my email address before emailing me.
www.bradflack.com
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:ORoLS6POEHA.1340@TK2MSFTNGP12.phx.gbl...
> > The ASP returns the date in DDMMYYYY to the page and it also enters the
> date
> > in the DB (or at least appears to) as DDMMYYYY.
> > Its all cosmetic but its not a moster application by any means, and this
> is
> > OK as long as it works!
> >
> > The Views work great using the DDMMYYYY format, or that they "appear" to
> > use.
>
> Display is one thing.  I *STRONGLY, STRONGLY* recommend you change the
> format that you pass into the database (not necessarily what the user
> enters, but between entry and passing) to a standard format that will not
> fail.  It's amazing how easy it is for some user to enter SET LANGUAGE
> ENGLISH mistakenly.  Or change regional settings on the machine.  Or what
> happens when you move your SQL Server to a different machine that isn't
set
> up properly.  Are you prepared to re-write all of your code during crisis
> time, or do you want to prepare for it in advance and sleep better at
night?
>
> http://www.aspfaq.com/2260
> http://www.aspfaq.com/2313
> http://www.karaszi.com/SQLServer/info_datetime.asp
>
>


Relevant Pages

  • Re: Date Problems - ASP/SQL
    ... > in the DB as DDMMYYYY. ... but between entry and passing) to a standard format that will not ... It's amazing how easy it is for some user to enter SET LANGUAGE ... Or change regional settings on the machine. ...
    (microsoft.public.inetserver.asp.general)
  • Re: DATE TIME FUNTIONS
    ... Format 101 won't translate month names, and if the server language is ... Spanish, it won't understand "Aug". ... If you SET LANGUAGE to us_english, ...
    (microsoft.public.sqlserver.programming)
  • Re: Determine 1st day of each month
    ... SET LANGUAGE US_ENGLISH ... SET DATEFORMAT DMY ... The only safe format in SQL Server, when converting from string to date, is ... Every other format will require care... ...
    (microsoft.public.sqlserver.programming)
  • Re: Suppress auto-hyphenation for a single word
    ... apply the format to Merleau? ... | Set Language to apply "Do not check spelling or grammar" formatting to it. ... Suppressing spelling/grammar checking also suppresses autohyphenation. ...
    (microsoft.public.word.docmanagement)
  • Re: Determine 1st day of each month
    ... >safe at all. ... >SET LANGUAGE US_ENGLISH ... Every other format will require care... ... There is one more safe string format, I think, the one BOL calls ...
    (microsoft.public.sqlserver.programming)