ASP Access and date problems
ASP Access and date problems
am 03.08.2005 19:49:02 von fmatosic
this is wierd. I have a field in my access db that is short date
(dd.mm.yyyy).
In the Query i have to write it out like this #dd/mm/yyyy#.
Done that OK
But now if the 'day' part of the day is two digit like 28.07.2005
works fine.
But if the 'day' part is one digit like 08.07.2005
it thinks that 08 is the month (mm.dd.yyyy) anybody know why????
Hate to have to check every date/day if it's <10 so i can formatt it.
I live in croatia, maybe it has something to do with the locale
if any ideas, I'll be grateful THX
Re: ASP Access and date problems
am 03.08.2005 20:12:26 von reb01501
polilop wrote:
> this is wierd. I have a field in my access db that is short date
> (dd.mm.yyyy).
> In the Query i have to write it out like this #dd/mm/yyyy#.
> Done that OK
> But now if the 'day' part of the day is two digit like 28.07.2005
> works fine.
> But if the 'day' part is one digit like 08.07.2005
> it thinks that 08 is the month (mm.dd.yyyy) anybody know why????
>
> Hate to have to check every date/day if it's <10 so i can formatt it.
>
> I live in croatia, maybe it has something to do with the locale
> if any ideas, I'll be grateful THX
http://www.aspfaq.com/show.asp?id=2040
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Re: ASP Access and date problems
am 04.08.2005 16:34:09 von fmatosic
Solved the problem another way
In global ASA i set the locale to English(US).
In forms is shown in dd/mm/yyyy but when sending to DB it send US locale
mm/dd/yyyy
"Bob Barrows [MVP]" wrote in message
news:emTvoeFmFHA.2180@TK2MSFTNGP15.phx.gbl...
> polilop wrote:
>> this is wierd. I have a field in my access db that is short date
>> (dd.mm.yyyy).
>> In the Query i have to write it out like this #dd/mm/yyyy#.
>> Done that OK
>> But now if the 'day' part of the day is two digit like 28.07.2005
>> works fine.
>> But if the 'day' part is one digit like 08.07.2005
>> it thinks that 08 is the month (mm.dd.yyyy) anybody know why????
>>
>> Hate to have to check every date/day if it's <10 so i can formatt it.
>>
>> I live in croatia, maybe it has something to do with the locale
>> if any ideas, I'll be grateful THX
>
> http://www.aspfaq.com/show.asp?id=2040
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
Re: ASP Access and date problems
am 04.08.2005 16:52:45 von reb01501
polilop wrote:
> Solved the problem another way
> In global ASA i set the locale to English(US).
> In forms is shown in dd/mm/yyyy but when sending to DB it send US
> locale mm/dd/yyyy
>
It may have "worked" for you, but it's still a bad idea to send dates in an
ambiguous format to a database. The database does not store them in any
particular format (assuming the column is a date/time column and not a Text
column). In Access, date/times are stored as Doubles, with the integer
portion representing the number of days since the seed date, and the decimal
portion representing the time of day.
You should use a format that is standard and universal: yyyy-mm-dd.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Re: ASP Access and date problems
am 04.08.2005 18:40:03 von fmatosic
OK. your right this dosen't couse no problems with locale hmmm think i'll do
your way.
Thx alot
"Bob Barrows [MVP]" wrote in message
news:ee4NuQQmFHA.1416@TK2MSFTNGP09.phx.gbl...
> polilop wrote:
>> Solved the problem another way
>> In global ASA i set the locale to English(US).
>> In forms is shown in dd/mm/yyyy but when sending to DB it send US
>> locale mm/dd/yyyy
>>
>
> It may have "worked" for you, but it's still a bad idea to send dates in
> an
> ambiguous format to a database. The database does not store them in any
> particular format (assuming the column is a date/time column and not a
> Text
> column). In Access, date/times are stored as Doubles, with the integer
> portion representing the number of days since the seed date, and the
> decimal
> portion representing the time of day.
>
> You should use a format that is standard and universal: yyyy-mm-dd.
>
> Bob Barrows
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>