Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 12 total
Thread problem in the recording of empty date
Sat, Feb 18 2006 1:48 PMPermanent Link

"Gabriel"
Delphi 7
dbisam 4.22 b5


I am using a query to record the information.

But when a date is empty, it is recorded 12.30.1899

How to do so that the recorded date is empty?


thanks

Gabriel
Brazil

Sat, Feb 18 2006 4:59 PMPermanent Link

"Mike Shkolnik"
> How to do so that the recorded date is empty?
yourDataset.FieldByName('yourDateFieldName).Clear;
or
yourDataset.FieldByName('yourDateFieldName).Value := NULL;

--
With best regards, Mike Shkolnik
E-mail: mshkolnik@scalabium.com
WEB: http://www.scalabium.com

Sat, Feb 18 2006 5:47 PMPermanent Link

"Gabriel"
Hello Mike:

I use query:


    if RxDateEdit1.Text <> '  /  /    ' then
     DM.Query0.ParamByName('T09_Baixa').AsDate := RxDateEdit1.Date
   else
     DM.Query0.ParamByName('T09_Baixa').Value  := Null;
===

using NULL display the message:
: T09_BAIXA is of an uncknow type

would you have another suggestion?

thank´s

Gabriel


"Mike Shkolnik" <mshkolnik2002@ukr.net> escreveu na mensagem
news:0FBE089A-97AE-4E28-B23F-04506FF58239@news.elevatesoft.com...
>> How to do so that the recorded date is empty?
> yourDataset.FieldByName('yourDateFieldName).Clear;
> or
> yourDataset.FieldByName('yourDateFieldName).Value := NULL;
>
> --
> With best regards, Mike Shkolnik
> E-mail: mshkolnik@scalabium.com
> WEB: http://www.scalabium.com
>
>

Sun, Feb 19 2006 5:00 PMPermanent Link

Tony Pomfrett
Gabriel,

Are you trying to set a parameter or a field value?

If setting a parameter, you need to define the parameter and its type.
The error message below is informing you that the parameter type has not
been set.

If you are trying to set a field value, use FieldByName instead of
ParamByName.

Tony.

Gabriel wrote:
> Hello Mike:
>
> I use query:
>
>
>      if RxDateEdit1.Text <> '  /  /    ' then
>       DM.Query0.ParamByName('T09_Baixa').AsDate := RxDateEdit1.Date
>     else
>       DM.Query0.ParamByName('T09_Baixa').Value  := Null;
> ===
>
> using NULL display the message:
> : T09_BAIXA is of an uncknow type
>
> would you have another suggestion?
>
> thank´s
>
> Gabriel
>
>
> "Mike Shkolnik" <mshkolnik2002@ukr.net> escreveu na mensagem
> news:0FBE089A-97AE-4E28-B23F-04506FF58239@news.elevatesoft.com...
>
>>>How to do so that the recorded date is empty?
>>
>>yourDataset.FieldByName('yourDateFieldName).Clear;
>>or
>>yourDataset.FieldByName('yourDateFieldName).Value := NULL;
>>
>>--
>>With best regards, Mike Shkolnik
>>E-mail: mshkolnik@scalabium.com
>>WEB: http://www.scalabium.com
>>
>>
>
>
>
Sun, Feb 19 2006 5:42 PMPermanent Link

"Gabriel"
delphi 7
dbisam 4.22 B5


   DM.Query0.Close;
   DM.Query0.SQL.Clear;
   DM.Query0.SQL.Add('Update T09_ACER ');
   DM.Query0.SQL.Add('Set             ');
   DM.Query0.SQL.Add('T09_Baixa     = :T09_Baixa ');
   DM.Query0.SQL.Add('Where           ');
   DM.Query0.SQL.Add('T09_NumAcervo = 100        ');

   if T09_Baixa.Text <> '  /  /    ' then
     DM.Query0.ParamByName('T09_Baixa').AsDate := T09_Baixa.Date
   else
     DM.Query0.ParamByName('T09_Baixa').AsDate := ????;    //  I need to
save NULL or  Nil or "" or empty
                                                                            
                      // and no 12.30.1899
   DM.Query0.ExecSQL;


help me.

Gabriel



"Tony Pomfrett" <tonyp@aline.com.au> escreveu na mensagem
news:43F8EA4F.6020001@aline.com.au...
> Gabriel,
>
> Are you trying to set a parameter or a field value?
>
> If setting a parameter, you need to define the parameter and its type. The
> error message below is informing you that the parameter type has not been
> set.
>
> If you are trying to set a field value, use FieldByName instead of
> ParamByName.
>
> Tony.
>
> Gabriel wrote:
>> Hello Mike:
>>
>> I use query:
>>
>>
>>      if RxDateEdit1.Text <> '  /  /    ' then
>>       DM.Query0.ParamByName('T09_Baixa').AsDate := RxDateEdit1.Date
>>     else
>>       DM.Query0.ParamByName('T09_Baixa').Value  := Null;
>> ===
>>
>> using NULL display the message:
>> : T09_BAIXA is of an uncknow type
>>
>> would you have another suggestion?
>>
>> thank´s
>>
>> Gabriel
>>
>>
>> "Mike Shkolnik" <mshkolnik2002@ukr.net> escreveu na mensagem
>> news:0FBE089A-97AE-4E28-B23F-04506FF58239@news.elevatesoft.com...
>>
>>>>How to do so that the recorded date is empty?
>>>
>>>yourDataset.FieldByName('yourDateFieldName).Clear;
>>>or
>>>yourDataset.FieldByName('yourDateFieldName).Value := NULL;
>>>
>>>--
>>>With best regards, Mike Shkolnik
>>>E-mail: mshkolnik@scalabium.com
>>>WEB: http://www.scalabium.com
>>>
>>>
>>
>>
Mon, Feb 20 2006 2:51 AMPermanent Link

"Iztok Lajovic"
Gabriel,

try to assign blank string to date (not tested):

>    DM.Query0.Close;
>    DM.Query0.SQL.Clear;
>    DM.Query0.SQL.Add('Update T09_ACER ');
>    DM.Query0.SQL.Add('Set             ');
>    DM.Query0.SQL.Add('T09_Baixa     = :T09_Baixa ');
>    DM.Query0.SQL.Add('Where           ');
>    DM.Query0.SQL.Add('T09_NumAcervo = 100        ');
>
>    if T09_Baixa.Text <> '  /  /    ' then
>      DM.Query0.ParamByName('T09_Baixa').AsDate := T09_Baixa.Date
>    else
>      DM.Query0.ParamByName('T09_Baixa').AsString := '';  <<<<  correct
> this line
>    DM.Query0.ExecSQL;
>

Iztok Lajovic

Mon, Feb 20 2006 5:43 AMPermanent Link

"Gabriel"
Hello. Iztok. This is not also correct.

EconvertError with message '' is not a valid date.



"Iztok Lajovic" <iztok.lajovic@amis.net> escreveu na mensagem
news:0C1F0AA2-A3FB-4D21-841C-E7C81537F15E@news.elevatesoft.com...

Gabriel,

try to assign blank string to date (not tested):

>
>>    DM.Query0.Close;
>>    DM.Query0.SQL.Clear;
>>    DM.Query0.SQL.Add('Update T09_ACER ');
>>    DM.Query0.SQL.Add('Set             ');
>>    DM.Query0.SQL.Add('T09_Baixa     = :T09_Baixa ');
>>    DM.Query0.SQL.Add('Where           ');
>>    DM.Query0.SQL.Add('T09_NumAcervo = 100        ');
>>
>>    if T09_Baixa.Text <> '  /  /    ' then
>>      DM.Query0.ParamByName('T09_Baixa').AsDate := T09_Baixa.Date
>>    else
>>      DM.Query0.ParamByName('T09_Baixa').AsString := '';  <<<<  correct
>> this line
>>    DM.Query0.ExecSQL;
>>
>
> Iztok Lajovic
>

Mon, Feb 20 2006 5:45 AMPermanent Link

"Mike Shkolnik"
Did you try the call the Clear method as I suggested in my first reply?

   if T09_Baixa.Text <> '  /  /    ' then
     DM.Query0.ParamByName('T09_Baixa').AsDate := T09_Baixa.Date
   else
      DM.Query0.ParamByName('T09_Baixa').Clear

--
With best regards, Mike Shkolnik
EMail: mshkolnik@scalabium.com
http://www.scalabium.com

"Gabriel" <mtg.comercio@bol.com.br> wrote in message
news:FA9A9F11-5587-4FB0-9C21-DC228F1F0105@news.elevatesoft.com...
> delphi 7
> dbisam 4.22 B5
>
>
>     DM.Query0.Close;
>     DM.Query0.SQL.Clear;
>     DM.Query0.SQL.Add('Update T09_ACER ');
>     DM.Query0.SQL.Add('Set             ');
>     DM.Query0.SQL.Add('T09_Baixa     = :T09_Baixa ');
>     DM.Query0.SQL.Add('Where           ');
>     DM.Query0.SQL.Add('T09_NumAcervo = 100        ');
>
>     if T09_Baixa.Text <> '  /  /    ' then
>       DM.Query0.ParamByName('T09_Baixa').AsDate := T09_Baixa.Date
>     else
>       DM.Query0.ParamByName('T09_Baixa').AsDate := ????;    //  I need to
> save NULL or  Nil or "" or empty
>
>                        // and no 12.30.1899
>     DM.Query0.ExecSQL;
>
>
> help me.
>
> Gabriel
>
>
>
> "Tony Pomfrett" <tonyp@aline.com.au> escreveu na mensagem
> news:43F8EA4F.6020001@aline.com.au...
> > Gabriel,
> >
> > Are you trying to set a parameter or a field value?
> >
> > If setting a parameter, you need to define the parameter and its type.
The
> > error message below is informing you that the parameter type has not
been
> > set.
> >
> > If you are trying to set a field value, use FieldByName instead of
> > ParamByName.
> >
> > Tony.
> >
> > Gabriel wrote:
> >> Hello Mike:
> >>
> >> I use query:
> >>
> >>
> >>      if RxDateEdit1.Text <> '  /  /    ' then
> >>       DM.Query0.ParamByName('T09_Baixa').AsDate := RxDateEdit1.Date
> >>     else
> >>       DM.Query0.ParamByName('T09_Baixa').Value  := Null;
> >> ===
> >>
> >> using NULL display the message:
> >> : T09_BAIXA is of an uncknow type
> >>
> >> would you have another suggestion?
> >>
> >> thank´s
> >>
> >> Gabriel
> >>
> >>
> >> "Mike Shkolnik" <mshkolnik2002@ukr.net> escreveu na mensagem
> >> news:0FBE089A-97AE-4E28-B23F-04506FF58239@news.elevatesoft.com...
> >>
> >>>>How to do so that the recorded date is empty?
> >>>
> >>>yourDataset.FieldByName('yourDateFieldName).Clear;
> >>>or
> >>>yourDataset.FieldByName('yourDateFieldName).Value := NULL;
> >>>
> >>>--
> >>>With best regards, Mike Shkolnik
> >>>E-mail: mshkolnik@scalabium.com
> >>>WEB: http://www.scalabium.com
> >>>
> >>>
> >>
> >>
>

Mon, Feb 20 2006 6:01 AMPermanent Link

"Gabriel"
not also:

edatabase error with message query0: field 'T09_BAIXA' is of unknown type.


"Mike Shkolnik" <mshkolnik2002@ukr.net> escreveu na mensagem
news:31472DC0-089C-4008-B9CC-54A3DA62BD22@news.elevatesoft.com...
> Did you try the call the Clear method as I suggested in my first reply?

   if T09_Baixa.Text <> '  /  /    ' then
     DM.Query0.ParamByName('T09_Baixa').AsDate := T09_Baixa.Date    // its
OK
   else
      DM.Query0.ParamByName('T09_Baixa').Clear        // error


> --
> With best regards, Mike Shkolnik
> EMail: mshkolnik@scalabium.com
> http://www.scalabium.com
>
> "Gabriel" <mtg.comercio@bol.com.br> wrote in message
> news:FA9A9F11-5587-4FB0-9C21-DC228F1F0105@news.elevatesoft.com...
>> delphi 7
>> dbisam 4.22 B5
>>
>>
>>     DM.Query0.Close;
>>     DM.Query0.SQL.Clear;
>>     DM.Query0.SQL.Add('Update T09_ACER ');
>>     DM.Query0.SQL.Add('Set             ');
>>     DM.Query0.SQL.Add('T09_Baixa     = :T09_Baixa ');
>>     DM.Query0.SQL.Add('Where           ');
>>     DM.Query0.SQL.Add('T09_NumAcervo = 100        ');
>>
>>     if T09_Baixa.Text <> '  /  /    ' then
>>       DM.Query0.ParamByName('T09_Baixa').AsDate := T09_Baixa.Date
>>     else
>>       DM.Query0.ParamByName('T09_Baixa').AsDate := ????;    //  I need to
>> save NULL or  Nil or "" or empty
>>
>>                        // and no 12.30.1899
>>     DM.Query0.ExecSQL;
>>
>>
>> help me.
>>
>> Gabriel
>>
>>
>>
>> "Tony Pomfrett" <tonyp@aline.com.au> escreveu na mensagem
>> news:43F8EA4F.6020001@aline.com.au...
>> > Gabriel,
>> >
>> > Are you trying to set a parameter or a field value?
>> >
>> > If setting a parameter, you need to define the parameter and its type.
> The
>> > error message below is informing you that the parameter type has not
> been
>> > set.
>> >
>> > If you are trying to set a field value, use FieldByName instead of
>> > ParamByName.
>> >
>> > Tony.
>> >
>> > Gabriel wrote:
>> >> Hello Mike:
>> >>
>> >> I use query:
>> >>
>> >>
>> >>      if RxDateEdit1.Text <> '  /  /    ' then
>> >>       DM.Query0.ParamByName('T09_Baixa').AsDate := RxDateEdit1.Date
>> >>     else
>> >>       DM.Query0.ParamByName('T09_Baixa').Value  := Null;
>> >> ===
>> >>
>> >> using NULL display the message:
>> >> : T09_BAIXA is of an uncknow type
>> >>
>> >> would you have another suggestion?
>> >>
>> >> thank´s
>> >>
>> >> Gabriel
>> >>
>> >>
>> >> "Mike Shkolnik" <mshkolnik2002@ukr.net> escreveu na mensagem
>> >> news:0FBE089A-97AE-4E28-B23F-04506FF58239@news.elevatesoft.com...
>> >>
>> >>>>How to do so that the recorded date is empty?
>> >>>
>> >>>yourDataset.FieldByName('yourDateFieldName).Clear;
>> >>>or
>> >>>yourDataset.FieldByName('yourDateFieldName).Value := NULL;
>> >>>
>> >>>--
>> >>>With best regards, Mike Shkolnik
>> >>>E-mail: mshkolnik@scalabium.com
>> >>>WEB: http://www.scalabium.com
>> >>>
>> >>>
>> >>
>> >>
>>
>
>

Mon, Feb 20 2006 12:30 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Gabriel,

Use the TDBISAMParam.Clear method:

   if T09_Baixa.Text <> '  /  /    ' then
     DM.Query0.ParamByName('T09_Baixa').AsDate := T09_Baixa.Date
   else
     begin
     DM.Query0.ParamByName('T09_Baixa').DataType:=ftDate;  // Be sure to
set the data type of the parameter
     DM.Query0.ParamByName('T09_Baixa').Clear;
     end;
   DM.Query0.ExecSQL;

--
Tim Young
Elevate Software
www.elevatesoft.com

Page 1 of 2Next Page »
Jump to Page:  1 2
Image