Subject | Re: [ib-support] Calendar |
---|---|
Author | Alexandre Benson Smith |
Post date | 2003-01-10T16:06:04Z |
If I need to do it I will do it on the client side (if this will be done
just once or not so often, if this is a routine that will be executed very
often use stored procs that will be faster), writing a simple Routine like
this one in delphi (NOTE: the code is not tested):
procedure Form1.Insert_Days(StartDate, EndDate:tDateTime);
begin
Query1.SQL.Text := 'Insert into days (day) values (:aDate)';
Query1.Prepare;
While StartDate <= EndDate do begin
Query1.ParamByName('aDate').AsDateTime := StartDate;
Query1.ExecSQL;
StartDate := StartDate + 1;
end;
Query1.Unprepare;
end;
or you could write an StoredProc to do the same increment the day by 1
(look on messages from last days that are talking about it) and go until
will reach the "EndDate".
see you !
Alexandre Benson Smith
Desenvolvimento
THOR Software e Comercial Ltda.
Santo André - SP
(11) 4992-3496/4990-8332
(11) 9222-3496 (cel.)
www.thorsoftware.com.br
At 15:38 10/01/2003 +0000, you wrote:
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.437 / Virus Database: 245 - Release Date: 06/01/2003
[Non-text portions of this message have been removed]
just once or not so often, if this is a routine that will be executed very
often use stored procs that will be faster), writing a simple Routine like
this one in delphi (NOTE: the code is not tested):
procedure Form1.Insert_Days(StartDate, EndDate:tDateTime);
begin
Query1.SQL.Text := 'Insert into days (day) values (:aDate)';
Query1.Prepare;
While StartDate <= EndDate do begin
Query1.ParamByName('aDate').AsDateTime := StartDate;
Query1.ExecSQL;
StartDate := StartDate + 1;
end;
Query1.Unprepare;
end;
or you could write an StoredProc to do the same increment the day by 1
(look on messages from last days that are talking about it) and go until
will reach the "EndDate".
see you !
Alexandre Benson Smith
Desenvolvimento
THOR Software e Comercial Ltda.
Santo André - SP
(11) 4992-3496/4990-8332
(11) 9222-3496 (cel.)
www.thorsoftware.com.br
At 15:38 10/01/2003 +0000, you wrote:
>Hi Folks!----------
>
>I'd like to create a calendar table inserting all of the day of the
>current year.
>Is there any way to select days or count of it from current month
>(and select months or count of it from current year)?
>Or any else ideas?
>
>TIA
>Sandor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.437 / Virus Database: 245 - Release Date: 06/01/2003
[Non-text portions of this message have been removed]