G
Guest
Hello,
I have a query that returns a date. When I see the output of the query, the
date is on the form dd.mm.yyyy , which is the standard Norwegian format, and
the format that is goven for short date in my regional settings in Windows.
Then I try looking up the record of a specific date, by entering 25.11.2006
in the date's criteria field, and sure enough, it returns only the records
that got this specific date in the date field. Access adds # in front and
behind the date.
However, when I try using this query as the row source for a list box in a
form I have, it all goes wrong. The relevant part of the SQL looks like this:
me.mylist.rowsource = ............ "WHERE myquery.date = #" me.DateInForm
"#;"
It enters the correct date in the rowsource, but I get a syntax error
message none the less.
I went back to the query, and entered 25.11.06 in the date criterea, and it
still worked. Then I looked at the query in SQL view, and to my surprise it
had re-written the WHERE clause's date-format to 11/25/2006. I have no idea
where it gets this format from, since everywhere I look in my application,
the dates are in the norwegian format.
I looked through the rest of my queries, and it seems like the same problem
occurs in every single one.
Can anyone give me an idea of what is going on here, and whay I can do to
remedy the problem? I spent 6 hours before I finally spotted the root of the
problem, so now I am really at my wit's end.
All help would be gratly appreaciated.
Baard
I have a query that returns a date. When I see the output of the query, the
date is on the form dd.mm.yyyy , which is the standard Norwegian format, and
the format that is goven for short date in my regional settings in Windows.
Then I try looking up the record of a specific date, by entering 25.11.2006
in the date's criteria field, and sure enough, it returns only the records
that got this specific date in the date field. Access adds # in front and
behind the date.
However, when I try using this query as the row source for a list box in a
form I have, it all goes wrong. The relevant part of the SQL looks like this:
me.mylist.rowsource = ............ "WHERE myquery.date = #" me.DateInForm
"#;"
It enters the correct date in the rowsource, but I get a syntax error
message none the less.
I went back to the query, and entered 25.11.06 in the date criterea, and it
still worked. Then I looked at the query in SQL view, and to my surprise it
had re-written the WHERE clause's date-format to 11/25/2006. I have no idea
where it gets this format from, since everywhere I look in my application,
the dates are in the norwegian format.
I looked through the rest of my queries, and it seems like the same problem
occurs in every single one.
Can anyone give me an idea of what is going on here, and whay I can do to
remedy the problem? I spent 6 hours before I finally spotted the root of the
problem, so now I am really at my wit's end.
All help would be gratly appreaciated.
Baard