Stef Merlijn
asked on
Update MS Access table through SQL
Hi,
Database : MS Access
Tablename : ChangeDate
Fieldname Status Date
New 23-12-2004
New 04-03-2004
New 13-11-2004
New 11-06-2004
I need to update one field (Status) in the dateset whenever the date in that record is in the past.
Result:
Fieldname Status Date
New 23-12-2004
Old 04-03-2004
New 13-11-2004
Old 11-06-2004
Can anybody give me the correct statement?
Thanks, Stef
Database : MS Access
Tablename : ChangeDate
Fieldname Status Date
New 23-12-2004
New 04-03-2004
New 13-11-2004
New 11-06-2004
I need to update one field (Status) in the dateset whenever the date in that record is in the past.
Result:
Fieldname Status Date
New 23-12-2004
Old 04-03-2004
New 13-11-2004
Old 11-06-2004
Can anybody give me the correct statement?
Thanks, Stef
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The above example expected the database is in the same directory with .exe
ASKER
Thanks.
Why do you this?
var
S: string;
begin
S := FormatDateTime('yyyymmdd', Date);
I don't see you use it futheron.
Stef
Why do you this?
var
S: string;
begin
S := FormatDateTime('yyyymmdd',
I don't see you use it futheron.
Stef
this is an unsuccessful attemt to assign TODAY as string, please ignore it....
download working example from :
page: http://www.geocities.com/esoftbg/
link: Q_21090692.zip
download working example from :
page: http://www.geocities.com/esoftbg/
link: Q_21090692.zip
> this is an unsuccessful attemt to assign TODAY as string, please ignore it....
mean that:
var
S: string;
and
S := FormatDateTime('yyyymmdd', Date);
to be ignored....
mean that:
var
S: string;
and
S := FormatDateTime('yyyymmdd',
to be ignored....
ASKER
Thanks Emil for your help and for the example on your site it works great.
Stef
Stef
Hi Delphiwizard,
You are welcome !
I did improve the example on my site. If you are interested, download it again ....
Best Regards,
Emil
You are welcome !
I did improve the example on my site. If you are interested, download it again ....
Best Regards,
Emil
var
S: string;
begin
S := FormatDateTime('yyyymmdd',
AdoQuery1.Connection := AdoConnection;
AdoQuery1.Sql.Text := ''
+ ' update CHANGEDATE '
+ ' set STATUS='
+ '''' + 'Old' + ''''
+ ' where DATES<=:TODAY'
+ '';
AdoQuery1.Parameters.Param
AdoQuery1.ExecSQL;
end;
procedure TForm1.ADOQueryCHANGESNewR
begin
ADOQueryCHANGES.FieldByNam
end;
emil