Re: [sqlite] Insert date

2008-04-25 Thread Federico Granata
On Linux I get

SQLite version 3.5.6
Enter ".help" for instructions
sqlite> CREATE TABLE Sighting (
   ...>  SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
   ...>  SpeciesId integer,
   ...>  LocationIdinteger,
   ...>  SightingDate  date,
   ...>  Note  nvarchar(100)
   ...> );
sqlite> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note) VALUES
(3005,22,'2/26/2008','New Note');
sqlite> select * from Sighting;
1|3005|22|2/26/2008|New Note


--
[image: Just A Little Bit Of
Geekness]
Le tre grandi virtù di un programmatore: pigrizia, impazienza e arroganza.
(Larry Wall).

On Fri, Apr 25, 2008 at 6:20 PM, Simon Davies <
[EMAIL PROTECTED]> wrote:

> 2008/4/25 lrjanzen <[EMAIL PROTECTED]>:
> >
> > I have the following table
> ...
> > and the following insert
> > INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
> > VALUES (3005,22,'2/26/2008','New Note')
> >
> > the insert works EXCEPT the date keeps coming in as NULL! What am I
> doing
> > wrong?
> >
> > Thanks
> > Lonnie
> >
>
> On XP I get
>
> SQLite version 3.4.2
> Enter ".help" for instructions
> sqlite>
> sqlite> CREATE TABLE Sighting (
>...>  SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
>   ...>  SpeciesId integer,
>   ...>  LocationIdinteger,
>   ...>  SightingDate  date,
>   ...>  Note  nvarchar(100)
>...> );
> sqlite>
> sqlite> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
>   ...> VALUES (3005,22,'2/26/2008','New Note');
> sqlite> select * from sighting;
> 1|3005|22|2/26/2008|New Note
> sqlite>
>
> What operating system, version, wrapper?
>
> Rgds,
> Simon
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert date

2008-04-25 Thread Simon Davies
2008/4/25 lrjanzen <[EMAIL PROTECTED]>:
>
> I have the following table
...
> and the following insert
> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
> VALUES (3005,22,'2/26/2008','New Note')
>
> the insert works EXCEPT the date keeps coming in as NULL! What am I doing
> wrong?
>
> Thanks
> Lonnie
>

On XP I get

SQLite version 3.4.2
Enter ".help" for instructions
sqlite>
sqlite> CREATE TABLE Sighting (
   ...>  SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
   ...>  SpeciesId integer,
   ...>  LocationIdinteger,
   ...>  SightingDate  date,
   ...>  Note  nvarchar(100)
   ...> );
sqlite>
sqlite> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
   ...> VALUES (3005,22,'2/26/2008','New Note');
sqlite> select * from sighting;
1|3005|22|2/26/2008|New Note
sqlite>

What operating system, version, wrapper?

Rgds,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert date

2008-04-25 Thread Scott Baker
Scott Baker wrote:
> lrjanzen wrote:
>> I have the following table
>> CREATE TABLE Sighting (
>>   SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
>>   SpeciesId integer,
>>   LocationIdinteger,
>>   SightingDate  date,
>>   Note  nvarchar(100)
>> );
>>
>> and the following insert
>> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
>> VALUES (3005,22,'2/26/2008','New Note')
>>
>> the insert works EXCEPT the date keeps coming in as NULL! What am I doing
>> wrong?
> 
> The date/time documentation details all the formats that SQLite 
> understands. You probably just want: -MM-DD.

I guess I should include a URL:

http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

-- 
Scott Baker - Canby Telcom
RHCE - System Administrator - 503.266.8253
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert date

2008-04-25 Thread Scott Baker
lrjanzen wrote:
> I have the following table
> CREATE TABLE Sighting (
>   SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
>   SpeciesId integer,
>   LocationIdinteger,
>   SightingDate  date,
>   Note  nvarchar(100)
> );
> 
> and the following insert
> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
> VALUES (3005,22,'2/26/2008','New Note')
> 
> the insert works EXCEPT the date keeps coming in as NULL! What am I doing
> wrong?

The date/time documentation details all the formats that SQLite 
understands. You probably just want: -MM-DD.

-- 
Scott Baker - Canby Telcom
RHCE - System Administrator - 503.266.8253
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert date

2008-04-25 Thread Emilio Platzer
try inserting year/month/day

Emilio

>
> I have the following table
> CREATE TABLE Sighting (
>   SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
>   SpeciesId integer,
>   LocationIdinteger,
>   SightingDate  date,
>   Note  nvarchar(100)
> );
>
> and the following insert
> INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
> VALUES (3005,22,'2/26/2008','New Note')
>
> the insert works EXCEPT the date keeps coming in as NULL! What am I doing
> wrong?
>
> Thanks
> Lonnie
>
> --
> View this message in context:
> http://www.nabble.com/Insert-date-tp16895860p16895860.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Insert date

2008-04-25 Thread lrjanzen

I have the following table
CREATE TABLE Sighting (
  SightingIdinteger PRIMARY KEY AUTOINCREMENT NOT NULL,
  SpeciesId integer,
  LocationIdinteger,
  SightingDate  date,
  Note  nvarchar(100)
);

and the following insert
INSERT INTO Sighting (SpeciesID,LocationID,SightingDate,Note)
VALUES (3005,22,'2/26/2008','New Note')

the insert works EXCEPT the date keeps coming in as NULL! What am I doing
wrong?

Thanks
Lonnie

-- 
View this message in context: 
http://www.nabble.com/Insert-date-tp16895860p16895860.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users