Re: Date Variable
- From: "Joel" <joel@xxxxxxxxx>
- Date: Tue, 27 Sep 2005 13:32:42 GMT
So if datDate = 0 VB will interpret it to be 12/30/1899? And I assume
assigning 0 to datDate is the only way to initialize it?
Also in my old DB I have a field Date_Paid defined as Date. What I would do
would test the value of the field if Date_Paid = "" It would mean the
record (transaction) is open. How do I test for such a condition now? I'm
using MySql.
Also I have a series of programs that does all kinds of updates. In order to
assure that procees was completed properly I have this safeguard: Before
that program is started I assign datProcess (Date Filed...MySql) to equal
Todays date datProcess = Today when I complete the job I null out (or used
to) the date. How do I do it now? (If I assign 0 then the field has a
value!)
Thank You
"Rick Rothstein [MVP - Visual Basic]" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx>
wrote in message news:pJidnXfUjata2aTeRVn-3w@xxxxxxxxxxxxxx
> > > I'm not sure exactly what you are asking here. Why do you
> think it
> > > would be any different than assigning a value to a date at any
> > > other time within your program? Perhaps if you explained what
> you
> > > are after in a little more detail, we might be able to give
> you a
> > > better answer.
> > >
> > I'm sorry how do initialize a date variable to have no value?
>
> You can't; there is no such thing as a Date without a value. A
> Date variable is initialized by VB as the "zero-date" which is
> December 30, 1899. Dates are stored as (but they are not actually)
> Double values, so the zero-date actually has a value of 0; but,
> since it is of type Date, the system will interpret that as
> December 30, 1899. Just so you know, the integer part of the
> Double used to hold date values stores the number of days passed
> from date-zero (positive is after date-zero, negative is before
> date-zero) and the fraction part of the Double stores the time
> part of the date (number of hours past midnight divided by the 24
> hours in a day).
>
> Rick
>
>
.
- Follow-Ups:
- Re: Date Variable
- From: Steve Gerrard
- Re: Date Variable
- References:
- Date Variable
- From: Joel
- Re: Date Variable
- From: Rick Rothstein [MVP - Visual Basic]
- Re: Date Variable
- From: Joel
- Re: Date Variable
- From: Rick Rothstein [MVP - Visual Basic]
- Date Variable
- Prev by Date: Re: SSTab - TabStrip
- Next by Date: Printing to only USB printer
- Previous by thread: Re: Date Variable
- Next by thread: Re: Date Variable
- Index(es):
Relevant Pages
|