INSERT date INTO SQLv6.5 Problem

Results 1 to 2 of 2

Thread: INSERT date INTO SQLv6.5 Problem

  1. #1
    Join Date
    Dec 1969

    Default INSERT date INTO SQLv6.5 Problem

    Adopting the practice of using the date format dd/mm/yyyy I have encountered the following problem with the ordering of the dd and mm fields:<BR><BR>My ASP/ADO pages construct the following SQL and execute it against the MS SQL 6.5 DB (latest SP applied) :<BR><BR>INSERT date INTO contract<BR>VALUES (&#039 15/06/2000&#039)<BR><BR>However, I receive &#039out of range&#039 error due to ADO being insistent on using mm/dd/yyyy ; even though I&#039ve made the following settings:<BR><BR>In ASP - Session.LCID = 2057(UK dd/mm/yy) Test- Now()date displays OK.<BR>In SQL DB - set dateformat dmy. Test- Dates store as dd/mm/yy OK.<BR>In NT - Regional Settings dd/mm/yy<BR><BR>Copying the SQL from ASP and pasting into iSQL produces the required result when executed, so what am I missing ?<BR>Or does date specific SQL executed from ASP/ADO *HAVE* to be in mm/dd/yy format ?<BR><BR>Any advice / guidance would be appreciated either in Reply or Email to -<BR>Thanks for preventing me going crazy.

  2. #2
    Jason Miller Guest

    Default General Date Advice

    If you want a string pre-interpreted as a date (as opposed to leaving VB to guess), delimit it with #s, not &#039s.

Posting Permissions

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