Re: updating date field in MS Access
- From: "Lambik" <lambik@xxxxxxxxxx>
- Date: Tue, 27 Feb 2007 23:25:06 +0100
"kath" <nitte.sudhir@xxxxxxxxx> wrote in message
news:1172557813.714277.263660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi,
I am having problem in updating tables in MS Access. The field which I
want to update is of DATE type.
here is the code..
#! C:\Perl\bin\perl.exe
use Win32::ODBC;
my $db = new Win32::ODBC('ServerStatistics');
$q="select distinct(build_date) from wdf_history";
$db->Sql($q);
while($db->FetchRow)
{
$s = $db->Data();
print $s;
}
$q = "select * from wdf_history where build_date='$s'";
while($db->FetchRow)
{
$s = $db->Data();
print $s;
}
$q="update wdf_history set build_date='2007-02-27' where
build_date='$s'";
$db->Sql($q);
Dateformat is wrong. In Access dates need to be enclosed by # (what is the
English phrase for that sign? Hash marks?) and Access stores the dates in
dd-mm-yyyy or mm-dd-yyyy depending on your windows country setting.. So:
$q="update wdf_history set build_date='#27-02-2007#' where ...
or
$q="update wdf_history set build_date='#02-27-2007#' where ...
You should try out what works for you.
Good luck.
.
- References:
- updating date field in MS Access
- From: kath
- updating date field in MS Access
- Prev by Date: using a list
- Next by Date: Re: using a list
- Previous by thread: updating date field in MS Access
- Next by thread: FAQ 7.12 What's a closure?
- Index(es):
Relevant Pages
|