1. pdate it is a datetime format 06/29/2005 11:00:00 AM
2. adate just a date 06/29/2005
I am trying to test this way but it does not work:
If pdate = adate + ' 11:00:00 AM' then
msgbox 'testing'
end if
By the way, the database is is SQL2K.
THANKS
are the pdate and adate columns both defined as date/time in the database?
If so then try
if dateserial(year(pdate),month(pdate),day(pdate))=adate then
If they are text then you can use the Mid$ and CInt functions to get the
arguments for DateSerial to build dates.
--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Convert them both to Longs and then check the values.
--
Regards,
Michael Cole
If DateValue(pdate) = DateValue(adate) Then
See also DateAdd and DateDiff in the help file, because you probably are
going to need them.
> Convert them both to Longs and then check the values.
Since Dates are represented internally as Double, with the integer part
representing whole days, and the fraction represents the fraction of the
day, the OP would have a problem if he or she used CLng(). CLng() rounds up
a fraction to the next whole number, i.e., CLng(1.5) = 2. "0.5" is a
representation of 12:00 PM(Midday). If the OP used Int() instead, then there
is no problem. I think you already know this, but a beginner could
misunderstand your answer.
"Michael Cole" <no...@hansen.com> wrote in message
news:uyLZ0Ity...@TK2MSFTNGP09.phx.gbl...