Re: [firebird-support] QUERY QUESTION

2017-03-03 Thread Si Carter s1car...@gmail.com [firebird-support]
You could use a stored procedure SET TERM ^ ; CREATE OR ALTER PROCEDURE CONSECUTIVE_DAYS (ipITEMNUMBER CHAR(3)) RETURNS (opDATEFROM DATE, opDATETO DATE, opCONSECUTIVEDAYS INTEGER) AS DECLARE VARIABLE vItem CHAR(3); DECLARE VARIABLE vDate DATE; BEGIN opCONSECUTIVEDAYS = 0; -- get latest

Re: [firebird-support] QUERY QUESTION

2017-03-03 Thread setysvar setys...@gmail.com [firebird-support]
Den 02.03.2017 17:36, skrev 'Stef' s...@autotech.co.za [firebird-support]: > Good day, > > I have a question for you SQL boffins, how can I query a table to get the > count of consecutive days found ? > > A Table contains rows with dates where an item(s) has been added for every > day this item was

RE: [firebird-support] QUERY QUESTION

2017-03-03 Thread 'Edward Mendez' emendez...@nc.rr.com [firebird-support]
Stef, Will this work. WITH CTE AS (SELECT J0.*, (SELECT COUNT(*) FROM TEST_TABLE S1 WHERE S1.DATEUSED >= J0.START_DATE AND S1.ITEMNR = J0.ITEMNR AND S1.DATEUSED < J0.END_DATE) + 1 DAYS FROM (SELECT DISTINCT

[firebird-support] NODELAY

2017-03-03 Thread Nick Upson n...@telensa.com [firebird-support]
Hi I noticed this (below) on a recent thread * tweaking xinetd (flags = REUSE NODELAY) I have a mainly real-time system with db response problems, does anyone have experience of using NODELAY,