On 11/22/2011 11:26 AM, Steffen Mangold wrote:
i have two little questions.
First one, is this valid syntax for a CASE WHEN?

CASE WHEN ( [field1] IS NOT NULL ) AND ( ( [field1]<  1 ) OR ( [field1]>  0 ) )

In special I mean "can I use AND, OR in CASE WHEN".

Yes. You can use any expression. AND and OR are operators, just like + or =

Second question, I get really strange results when I try to compare time values.
For example:

Given is a table with a field [field1] data type 'time'.

SQLite doesn't have a dedicated "time" type. There are many ways to store time values - e.g. as a string '12:34', or as a number of seconds from midnight.

How exactly do you put your time values into the field?

Now I make a compare in a trigger like this.
[field1]<  TIME(NEW.TimeStamp)

TIME() produces a string of the form '12:34:56' (hours:minutes:seconds). What's in NEW.TimeStamp? What's in field1?

See also http://sqlite.org/lang_datefunc.html
--
Igor Tandetnik

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

Reply via email to