Re: updating date field in MS Access



"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.


.



Relevant Pages

  • Re: Windows 2000 Update Installation failure
    ... > auto update. ... I was able to load the ... >>>I tried this as well and no luck. ... I also tried updating BITS. ...
    (microsoft.public.windowsupdate)
  • Re: PC standby freeze-up
    ... >Have you tried reinstalling or updating your Windows XP ... >Thanks and best of luck! ...
    (microsoft.public.windowsxp.basics)
  • Re: Sails
    ... What are you replacing her with? ... with luck and a good survey... ... I'm still trying to get a deep water mooring big enough for her, ... She also needs a lot of updating, but that is in line with the ...
    (uk.rec.sailing)
  • Re: Digital audio sound on MSI Media Live
    ... "product reviews on Newegg" mentioned here: ... Good luck! ... updating the BIOS and setting 8ch Audio to be disables ...
    (Ubuntu)
  • Disable or uninstall anti viru before another SP3 installation att
    ... updating with my Bit Defender 2008 anti virus disabled, ... tried updating with a burned_ to_ CD ISO image of the update. ... No luck. ... colors of some letters in file names, to the same colors of file name letters ...
    (microsoft.public.windowsupdate)