<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://sqlzoo.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://sqlzoo.net/w/index.php?title=INSERT_a_date&amp;feed=atom&amp;action=history</id>
		<title>INSERT a date - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://sqlzoo.net/w/index.php?title=INSERT_a_date&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=INSERT_a_date&amp;action=history"/>
		<updated>2013-05-24T23:47:12Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.4</generator>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=INSERT_a_date&amp;diff=1688&amp;oldid=prev</id>
		<title>Marek at 09:14, 18 July 2012</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=INSERT_a_date&amp;diff=1688&amp;oldid=prev"/>
				<updated>2012-07-18T09:14:24Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:14, 18 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 62:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 62:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;quot;30 days hath September...&amp;quot;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;quot;30 days hath September...&amp;quot;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;mysql&lt;/del&gt;&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;Oracle can be made to accept almost any format if we use the TO_DATE function. Details at&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;oracle&lt;/ins&gt;&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;Oracle can be made to accept almost any format if we use the TO_DATE function. Details at&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[http://oradoc.photo.net/ora817/DOC/server.817/a85397/sql_elem.htm#34926 Date Format Elements]&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[http://oradoc.photo.net/ora817/DOC/server.817/a85397/sql_elem.htm#34926 Date Format Elements]&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{INSERT and DELETE ref}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{INSERT and DELETE ref}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Marek</name></author>	</entry>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=INSERT_a_date&amp;diff=1455&amp;oldid=prev</id>
		<title>Marek: Created page with &quot;Insert a date. &lt;div class='ht'&gt; &lt;div class=params&gt;schema:scott&lt;/div&gt; &lt;div&gt; The format of dates can be very tricky. Most implementations are fairly robust in what will be accep...&quot;</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=INSERT_a_date&amp;diff=1455&amp;oldid=prev"/>
				<updated>2012-07-17T10:44:58Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Insert a date. &amp;lt;div class=&amp;#039;ht&amp;#039;&amp;gt; &amp;lt;div class=params&amp;gt;schema:scott&amp;lt;/div&amp;gt; &amp;lt;div&amp;gt; The format of dates can be very tricky. Most implementations are fairly robust in what will be accep...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Insert a date.&lt;br /&gt;
&amp;lt;div class='ht'&amp;gt;&lt;br /&gt;
&amp;lt;div class=params&amp;gt;schema:scott&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
The format of dates can be very tricky. Most implementations&lt;br /&gt;
are fairly robust in what will be accepted - but a date such&lt;br /&gt;
as 01-02-03 might be interpreted in different ways in different&lt;br /&gt;
countries.&lt;br /&gt;
&lt;br /&gt;
Using a three character month and a four digit year in single&lt;br /&gt;
quotes (such as '01 Mar 1997') works safely with most systems&lt;br /&gt;
other than MySQL.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=sql class='tidy'&amp;gt;DROP TABLE t_x&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=sql class='setup'&amp;gt;CREATE TABLE t_peep&lt;br /&gt;
 (id INTEGER PRIMARY KEY&lt;br /&gt;
 ,name VARCHAR(50))&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-db2'&amp;gt;CREATE TABLE t_x (x VARCHAR(5), y DATE);&lt;br /&gt;
DELETE FROM t_x;&lt;br /&gt;
INSERT INTO t_x VALUES ('Ryka', '1997-03-01');&lt;br /&gt;
SELECT * FROM t_x&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-access'&amp;gt;CREATE TABLE t_x (x VARCHAR(5), y DATETIME);&lt;br /&gt;
INSERT INTO t_x VALUES ('Ryka','01 Mar 1997');&lt;br /&gt;
INSERT INTO t_x VALUES ('Olly',#25 May 1985#);&lt;br /&gt;
SELECT * FROM t_x&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-mysql'&amp;gt;CREATE TABLE t_x (x VARCHAR(5), y DATE);&lt;br /&gt;
INSERT INTO t_x VALUES ('Ryka','1997-03-01');&lt;br /&gt;
INSERT INTO t_x VALUES ('Impos','1997-09-31');&lt;br /&gt;
SELECT * FROM t_x&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-oracle'&amp;gt;INSERT INTO t_x VALUES ('Ryka','01 Mar 1997');&lt;br /&gt;
INSERT INTO t_x VALUES ('Milly', &lt;br /&gt;
   TO_DATE('July 9, 1995', &lt;br /&gt;
           'Month dd, YYYY, HH24:MI'));&lt;br /&gt;
SELECT * FROM t_x&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-sqlserver'&amp;gt;CREATE TABLE t_x (x VARCHAR(5), y DATETIME);&lt;br /&gt;
INSERT INTO t_x VALUES ('Ryka','01 Mar 1997');&lt;br /&gt;
SELECT * FROM t_x&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;CREATE TABLE t_x (x VARCHAR(5), y DATE);&lt;br /&gt;
INSERT INTO t_x VALUES ('Ryka', DATE '1997-03-01');&lt;br /&gt;
SELECT * FROM t_x&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-sqlite&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;All data types are ignored, simple strings are used.&lt;br /&gt;
Given this you should use 'yyyy-mm-dd', your dates will at least be&lt;br /&gt;
ordered.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-access&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;When used within VBA Access likes dates to be enclosed in hash signs...&lt;br /&gt;
&lt;br /&gt;
#20 May 1962#&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-mysql&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;MySQL only accepts dates in the format yyyy-mm-dd.&lt;br /&gt;
&lt;br /&gt;
Be warned that it will accept dates that don't&lt;br /&gt;
exist - such as 31st September.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;30 days hath September...&amp;quot;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-mysql&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;Oracle can be made to accept almost any format if we use the TO_DATE function. Details at&lt;br /&gt;
[http://oradoc.photo.net/ora817/DOC/server.817/a85397/sql_elem.htm#34926 Date Format Elements]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{INSERT and DELETE ref}}&lt;/div&gt;</summary>
		<author><name>Marek</name></author>	</entry>

	</feed>