Help with Date!

Results 1 to 2 of 2

Thread: Help with Date!

  1. #1
    Tara Guest

    Default Help with Date!

    I have a database with a date field. I did have it as a text field, but had to change it to a date field (mm/dd/yy) to sort by it. So I have several places where people can edit their info, and it updates it to today&#039s date (CompanyRS(&#039DATE_UPDATED&#039)=Date). However, I have one administration page where the webmaster can edit the company information, INCLUDING the date the record was updated. When I use that page, it makes the date updated blank. I am sure I&#039m obviously formatting the data input incorrectly, but can someone help me figure this out?<BR><BR>Thanks.<BR>Tara

  2. #2
    Join Date
    Dec 1969

    Default RE: Help with Date!

    The best format for a date literal in a SQL string is what&#039s called "ODBC Canonical Format" (or some such) and it looks like this:<BR><BR>{d &#039yyyy-mm-dd&#039}<BR><BR>eg:<BR><BR>INSERT table (datefld) VALUES {d &#039 2000-06-28&#039}<BR><BR>There is also a timestamp format: {ts &#039yyyy-mm-dd hh:mm:ss&#039}<BR><BR>What&#039s so good about this? Well, it&#039s the only date format I know of that&#039s recongised by both SQL Server and Access (and Oracle, and MySQL, and etc...) and it&#039s also the only date format that is unambigious. That&#039s a big issue because there are *at least* 3 different ways to interpret a 6-digit date (eg 01/02/03 - which is months, days and years?) and 2 ways to interpret an 8-digit date (as you quickly learn if you&#039re European).<BR><BR>HTH<BR><BR>Dunc

Posting Permissions

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