Muitos sistemas fazem varias pesquisas e calculos utilizando datas e horas. Existem varias formas de fazer isso em delphi, Java e outras linguagens, mas a melhor forma ainda e, no caso de uma adicao fixa, fazer isso no SQL. Vou colocar aqui alguns exemplos de funcoes especificas para DATA e HORA que o firebird possui.DATEADD()Available in: DSQL, PSQL Added in: 2.1 Description: Adds the specified number of years, months, days, hours, minutes, seconds or milliseconds to a date/time value. Result type: DATE, TIME or TIMESTAMPSyntax: DATEADD () args ::= TO | , , amount ::= an integer expression (negative to subtract)unit ::= YEAR | MONTH | DAY | HOUR | MINUTE | SECOND | MILLISECONDdatetime ::= a DATE, TIME or TIMESTAMP expression The result type is determined by the third argument. With DATE arguments, only YEAR, MONTH and DAY can be used. With TIME arguments, only HOUR, MINUTE, SECOND and MILLISECOND can be used. Examples: dateadd (28 day to current_date)dateadd (-6 hour to current_time)dateadd (month, 9, DateOfConception)dateadd (minute, 90, time 'now')dateadd (? year to date '11-Sep-1973')DATEDIFF()Available in: DSQL, PSQL Added in: 2.1 Description: Returns the number of years, months, days, hours, minutes, seconds or milliseconds elapsed between two date/time values. Result type: BIGINTSyntax: DATEDIFF () ::= FROM TO | , , ::= YEAR | MONTH | DAY | HOUR | MINUTE | SECOND | MILLISECOND ::= a DATE, TIME or TIMESTAMP expression DATE and TIMESTAMP arguments can be combined. No other mixes are allowed. With DATE arguments, only YEAR, MONTH and DAY can be used. With TIME arguments, only HOUR, MINUTE, SECOND and MILLISECOND can be used. Computation: DATEDIFF doesn't look at any smaller units than the one specified in the first argument. As a result, o datediff (year, date '1-Jan-2009', date '31-Dec-2009') returns 0, but o datediff (year, date '31-Dec-2009', date '1-Jan-2010') returns 1 It does look, however, at all the bigger units. So: o datediff (day, date '26-Jun-1908', date '11-Sep-1973') returns 23818 A negative return value indicates that moment2 lies before moment1. Examples: datediff (hour from current_timestamp to timestamp '12-Jun-2059 06:00')datediff (minute from time '0:00' to current_time)datediff (month, current_date, date '1-1-1900')datediff (day from current_date to cast(? as date))http://www.firebirdsql.org/ Quando estamos desenvolvendo sistemas desktops podemos utilizar diferentes L&F, por isto estarei postando aqui um codigo de como carregar um L&F de maneira bem simples e mostrando para quem nunca trabalhou com isso, uma forma simples e rapida de listar todos os L&F existentes na versao do Java existente em seu computador: try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (Exception ex) { JOptionPane.showMessageDialog(null, "Problems to change L&F. "+ex, "ERRO", JOptionPane.ERROR_MESSAGE); }Neste exemplo eu faco um laco passando por todos os L&F, caso possua o L&F Nimbus eu seto ele e caio fora do laco. Essa pequena classe cria um novo servico no windows com o nome "mysqymeu" e starta o mesmo. Nao irei explicar o codigo pois e de facil entendimento. Criei um topico no GUJ, com duvidas de como executar um comando no cmd do Windows caso alguem queira dar uma