Re: IsWeekend() or IsWeekday()
- From: "Dag Sunde" <me@xxxxxxxxxxxx>
- Date: Tue, 20 Dec 2005 08:27:15 GMT
"Steve Gerrard" <mynamehere@xxxxxxxxxxx> wrote in message
news:B5Odna0DspaD4jreRVn-pQ@xxxxxxxxxxxxxx
>
> "Rick Ratchford" <nospam@xxxxxxxxxxxxxx> wrote in message
> news:6fKpf.29660$QW2.21312@xxxxxxxxxxxxx
>> Are you saying that using the Date type takes care of the problem I'm
>> describing? How?
>>
>> Inquiring minds want to know.
>>
>> :-)
>>
>>
>> "Steve Gerrard" <mynamehere@xxxxxxxxxxx> wrote in message
>> news:2LudnTWtie1JwzreRVn-oA@xxxxxxxxxxxxxx
>>> Hey, didn't you ask in another thread, on the subject of
>>> dates-as-strings, something like:
>>> "But what kind of trouble could I be asking for? It seems to work
>>> fine..."
>>>
>>> Seems to me you know more about what kind of trouble than you are
>>> letting on...:)
>>>
>>>
>>
>>
>
> Actually, I meant to point out that perhaps the other programmer thought
> the same thing: what harm is there in exporting my dates as strings? It
> seems to work fine...
>
> I'm not saying that a date type can automagically fix dates-as-strings
> problems. I am saying that date types can avoid creating more
> dates-as-strings problems.
I was the other programmer...
I too work with a lot of cases like this, where I need to import/parse text
data
files. And that is actually one of the things that led me to avoid using the
date
data type except when absolutely neccessary.
I need to be *absolutely* certain that I got the correct date, so I can't
trust
vb to interpret 11/11/01, or any other variation. I _must_ know.
"Dates as strings" in my experience causes much less trouble, as long as you
always format them as ISO dates: http://www.w3.org/QA/Tips/iso-date.
But to the OP's problem: What I do in situations when I need to read such
files
is that I either trust the system national settings (ie. ask the NLS for the
date-separator and date format), or have an [import format] section in my
apps
config-file, where the user can override the date mask to use when
importing.
No need to worry about me using strings internally Steve. Your example in
another
thread (Format$(CDate("2005-12-20"), "yyyymmdd")) is absolutely correct. I
*do*
take a performance penalty because of the implicit CDate(dte). But I sleep
better
at night, because I _know_ that dte is always in the unambigious ISO format
that
can't be misinterpreted.
Just one of my quirks... :-)
--
Dag.
.
- References:
- IsWeekend() or IsWeekday()
- From: Rick Ratchford
- Re: IsWeekend() or IsWeekday()
- From: Frank Adam
- Re: IsWeekend() or IsWeekday()
- From: Rick Ratchford
- Re: IsWeekend() or IsWeekday()
- From: SmilingPolitely
- Re: IsWeekend() or IsWeekday()
- From: Rick Ratchford
- Re: IsWeekend() or IsWeekday()
- From: Steve Gerrard
- Re: IsWeekend() or IsWeekday()
- From: Rick Ratchford
- Re: IsWeekend() or IsWeekday()
- From: Steve Gerrard
- IsWeekend() or IsWeekday()
- Prev by Date: Re: IsWeekend() or IsWeekday()
- Next by Date: Happy Christmas.
- Previous by thread: Re: IsWeekend() or IsWeekday()
- Next by thread: Re: IsWeekend() or IsWeekday()
- Index(es):
Relevant Pages
|