[sqlite] Get the data from previous months: please, help me to optimize the query...

2007-07-13 Thread elemaco71-sqlite
Hello, everybody I have the following problem: I have the following tables: Months -- CREATE TABLE 'Months' ( IDMonth INTEGER PRIMARY KEY NOT NULL, MonthRef INTEGER ); (where MonthRef is the date of the first day of the month - created in the code) C

Re: [sqlite] Use "computed" fields to get the value of other fields.

2006-07-17 Thread elemaco71-sqlite
Hello, and thanks for the reply. SELECT * from Employees where IDContractLevel > 4 is not enough, since I actually need to use a field that is created inside the SQL statement to create another field. The problem is that it seems that the computed fields is not existing yet when it is used for

[sqlite] Use "computed" fields to get the value of other fields.

2006-07-17 Thread elemaco71-sqlite
Hello, everybody I'm using a SQL clause to get data from the DB, and I need to use "computed" fields to get the value of other fields. A (stupid) example of what I need is this: SELECT IDContractLevel, IDContractLevel > 4 as IAmBoss, (SELECT * FROM Bosses WHERE Flag = IAmBoss) FROM Employees

Re: [sqlite] Group a set of events by day: howto??

2006-07-10 Thread elemaco71-sqlite
Hello, and thanks for the reply. I dont' know PHP, but I can understand that you are suggesting to "manually" iterate the records to find the events, and group them by day. Is this right? "C.Peachment" <[EMAIL PROTECTED]> ha scritto: What is wrong with using: select EventID, EventDate, Event

[sqlite] Group a set of events by day: howto??

2006-07-10 Thread elemaco71-sqlite
Hello, everybody I have the following problem: I have a table that contains "Events", with the related date and time: Fields: EventID EventDate EventTime I would like to "group" these records by day, returning all the "times" of the events, like: EventID, EventDate, EventTime1, EventTime2, E