Re: [sqlite] Hi, a question from Colombia

2009-01-12 Thread Ribeiro, Glauber
Brazil, but living in the Chicago area of the USA since 1991. 

-Original Message-
From: MikeW [mailto:mw_p...@yahoo.co.uk] 
Sent: Monday, January 12, 2009 6:35 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Hi, a question from Colombia

Ribeiro, Glauber <glauber.ribe...@...> writes:

> 
> Carlos,
> 
> If you don't mind, I'll answer through the list, because there are
> people there who know much more than I do.
> 
> 
> glauber
> 
Hey, glauber, you didn't say which country you were from !
;-)

MikeW (UK)


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


Re: [sqlite] Hi, a question from Colombia

2009-01-12 Thread MikeW
Ribeiro, Glauber  writes:

> 
> Carlos,
> 
> If you don't mind, I'll answer through the list, because there are
> people there who know much more than I do.
> 
> 
> glauber
> 
Hey, glauber, you didn't say which country you were from !
;-)

MikeW (UK)

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


Re: [sqlite] Hi, a question from Colombia

2009-01-09 Thread Ribeiro, Glauber
Carlos,

If you don't mind, I'll answer through the list, because there are
people there who know much more than I do.

Here's your question:


> Here I'm looking for subtract two datefields from diferentes tables if

> the field1 is not null, if that field is null the value is 'without 
> close' and this case conditional
>
> CASE
>WHEN field1 IS NULL
> THEN 'SIN CERRAR'
> ELSE (STRFTIME('%J',field1) - STRFTIME('%J',field2))
> END AS DIAS_CERRAR,


How are you storing your dates? SQLite doesn't have a true date format,
so you need to store it either as a string or a number (which could be a
Julian date, a Unix-style number of seconds since a reference date, or
something else even).

Assuming you are storing your dates as strings like this: 2009-01-09,
the code above should give the difference, in days, between the 2 dates.
Is it not working for you?




> and this
>
> convert(STRFTIME('%J',field1) - STRFTIME('%J',field2))


I'm not sure what this is; convert() is not a standard function in
SQLite. Is this from hsql? Or is it a user-defined function?


glauber



 

-Original Message-
From: Carlos Suarez [mailto:carlos.sua...@rolsoft.com] 
Sent: Friday, January 09, 2009 1:14 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] Hi, a question from Colombia

Hi, my name is Carlos Suarez from Colombia, I have a few problems while 
I migrated from hsql to sqlite and I want to know if you can help me 
with some of this stuff by this way of mail or have I  to quote in 
somewhere?.

thanksfully

Carlos Suarez



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


Re: [sqlite] Hi, a question from Colombia

2009-01-09 Thread Ribeiro, Glauber
Hi, Carlos,

People here are helpful and friendly, and we will try to help you in our
abundant free time, but try to include as much information as possible
with your question, so we can give you meaningful answers.

For example, don't just ask "why is my SQL so slow?", but tell us
specifically what SQL you are running, number or records in your table,
kind of computer, anything that might help us figure it out.

glauber

-Original Message-
From: Carlos Suarez [mailto:carlos.sua...@rolsoft.com] 
Sent: Friday, January 09, 2009 1:14 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] Hi, a question from Colombia

Hi, my name is Carlos Suarez from Colombia, I have a few problems while 
I migrated from hsql to sqlite and I want to know if you can help me 
with some of this stuff by this way of mail or have I  to quote in 
somewhere?.

thanksfully

Carlos Suarez



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


Re: [sqlite] Hi, a question from Colombia

2009-01-09 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Carlos Suarez wrote:
> Hi, my name is Carlos Suarez from Colombia, I have a few problems while 
> I migrated from hsql to sqlite and I want to know if you can help me 
> with some of this stuff by this way of mail or have I  to quote in 
> somewhere?.

Follow this:

 http://www.catb.org/~esr/faqs/smart-questions.html

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAklnu+oACgkQmOOfHg372QReegCgtkujle3SF/8jpAATRTMk4FnU
pCwAnizzPz0Aj6HhSwhBvn4bWUSfPAZ/
=81Nc
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users