
Signature
\\// Live Long and Prosper \\//
>> > For date, you add #
>> > " Where FieldName = #" & Var & "#"
[quoted text clipped - 4 lines]
> What is the connection to USA and #, I don't use USA date and still
> use # before and after the date.
If you really mean that the way you have typed it, then you are almost
certainly in trouble. Using a phrase like
WHERE SomeDate = #01/03/2006#
will return dates in January -- wherever you are in the world. And the
danger is that a VBA expression like
"WHERE SomeDate = #" & MyDate & "#"
will use whatever format is typed into the control panel Regional
Settings. If you are lucky, that is a USA or ISO format (the latter
extremely unlikely, I should guess). If you are a bit lucky, then it
might be one with english fullnames (like "dd mmmm yyyy") which will also
be parsed correctly. Otherwise, you'll put a dmy date into the string
which may or may not be parsed correctly. In any case, it's out of your
control as the developer and that is a Bad Thing. The only safe way to do
things is to manage the formatting yourself:
"WHERE SomeDate = " & Format(SomeDate, "\#yyyy\-mm\-dd\#")
> Unless you use it with SQL
What else? From the original post:
>>> I'm having trouble getting my SQL Update Query to read <<<
Remember that DLookup() and related functions pass their criterion
strings straight through to the db engine, so the same syntax applies.
Best wishes
Tim F
Ofer - 07 Jan 2006 19:23 GMT
It's just that I'm a part of the 94%, and I never needed to set up the
format, unless sending parameters to the SQL Server, then I needed to change
the format on the date.
In my organization, the Regional Settings are set automatically as we want
when the user log on, so they all set the same, so I assume this is why I
never had the need to set the format.
Thanks for clarifying it for me.

Signature
\\// Live Long and Prosper \\//
> >> > For date, you add #
> >> > " Where FieldName = #" & Var & "#"
[quoted text clipped - 38 lines]
>
> Tim F
Tim Ferguson - 08 Jan 2006 19:00 GMT
> It's just that I'm a part of the 94%, and I never needed to set up the
> format, unless sending parameters to the SQL Server, then I needed to
> change the format on the date.
I am very suspicious about how this is working; unless you are using
exclusively GUI methods like DoCmd.RunSQL and so on, where the Access
expression evaluator will intercept and make silent changes to the queries.
Although this usually works out okay, it tends to creep me out: I like to
get the thing debugged and working and then left alone!
> I ment SQL Server then you use single quote (I'm not sure about other DB)
I am not an SQL Server expert, but with the little work I have done using
ADP-ADO-MSSQLS the date format seems to be "\'yyyymmdd\'" -- I rather think
that you have Access doing this for you behind your back.
All the best
Tim F
I ment SQL Server then you use single quote (I'm not sure about other DB)

Signature
\\// Live Long and Prosper \\//
> I don't follow, what do you mean?
> What is the connection to USA and #, I don't use USA date and still use #
[quoted text clipped - 7 lines]
> >
> > Tim F