View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Santiago[_2_] Santiago[_2_] is offline
external usenet poster
 
Posts: 26
Default VBA / SQL: problem with dates

I've tried both: with the format() function and also with unambiguous
dates... doesn't work...

It's quite annoying I must say... you work out your code and doesn't work
because of these format matters... :-(

"Bob Phillips" wrote:

Have you tried an unambiguous date string like "15-Jan-2005"?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andy Wiggins" wrote in message
...
Try wrapping the date in the FORMAT function so, instead of #15/01/2005#,
you have FORMAT(#15/01/2005#,"dd-mmm-yyyy").

It just might be that VBA or SQL (or both) are trying to recognise an
American date format rather than the English format.

--
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy
-

"Santiago" wrote in message
...
Hey guys,

I'm trying to update some data in an Access DB from Excel using ADO &

SQL.
I'd like to update some fields with a defined criteria using the WHERE

clause
in SQL, but dates seem not to work...

I use the SQL string like:

UPDATE [table] SET [field1] = 'aa', [field2] = #15/01/2005# etc... _
WHERE [field3] = 'bla' AND [field4] = #01/01/2005#

I believe that the problem is the date I'm filtering... I copied the

whole
SQL string into access and did not work. But if I remove the date

criteria
seems to work.

I appreciate your help.
Thanks & Bregards

Santiago