Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread How to insert a blank date into an update query
Tue, Nov 27 2012 7:46 PMPermanent Link

Paul Coshott

Avatar

Hi,

I am using an update query with params to set the values. One of the fields
is a date. What does the date param need to be set to for a blank date?

The update query is :

Update Members
   Set MemberName = :MName,
         JoinDate = :JDate
   Where MemberId = :MId

My code is :

with qMemberUpdate do begin
 ParamByName('MId').AsInteger := intMemId;
 ParamByName('MName').AsString := edtMemberName.Text;
 if edtJoinDate.Text = '' then begin
   ParamByName('JDate').AsDate := *********************  <-- what should
this be for a blank date
 end else begin
   ParamByName('JDate').AsDate := edtJoinDate.Date;
 end;

Thanks for any help,
Paul
Wed, Nov 28 2012 5:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Paul

I think its

> if edtJoinDate.Text = '' then begin
> ParamByName('JDate').Clear  <<<<<<<<<<<<<<<<<
>this be for a blank date
> end else begin
> ParamByName('JDate').AsDate := edtJoinDate.Date;
> end;

Not sure since its a long time ago I did something like this

Roy Lambert [Team Elevate]
Wed, Nov 28 2012 9:19 PMPermanent Link

Paul Coshott

Avatar

Hi Roy,

You got it! Works perfectly. Thanks.

Paul

"Roy Lambert"  wrote in message
news:A8005228-9D54-4137-9619-C095210B265E@news.elevatesoft.com...

Paul

I think its

> if edtJoinDate.Text = '' then begin
> ParamByName('JDate').Clear  <<<<<<<<<<<<<<<<<
>this be for a blank date
> end else begin
> ParamByName('JDate').AsDate := edtJoinDate.Date;
> end;

Not sure since its a long time ago I did something like this

Roy Lambert [Team Elevate]
Image