Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > problem on Date/Time Data Type

Reply
Thread Tools

problem on Date/Time Data Type

 
 
leo
Guest
Posts: n/a
 
      10-24-2005
Hello there

Im having trouble in storing blank or space value on a variable wich data
type is Date/Time, if i make a statement like this

Field Data Type
CPARCAVEDate Date/Time

strCPARCAVEDate = rstFEVV.fields("CPARCAVEDate").value

if strCPARCAVEDate = "" then
counter = counter + 1
end if

The value doesnt increment. Do you guys have an idea how to recognize a no
value

Thanks
Leo



 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      10-24-2005
IsNull()
IsEmpty()
Len()

ASP isn't like VB, so most of the time (depending on what you are doing of
course), you can switch datatype checks while you go ...

e.g;

sSomeDate = "10/05/2005"
Response.Write "sSomeDate: " & sSomeDate & "<br><br>"
Response.Write "Len: " & Len(sSomeDate) & "<br>"
Response.Write "IsNull: " & IsNull(sSomeDate) & "<br>"
Response.Write "IsEmpty: " & IsEmpty(sSomeDate) & "<br>"

http://mysteryfcm.plus.com/misc/pdatatype.asp


--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"leo" <> wrote in message
news:...
> Hello there
>
> Im having trouble in storing blank or space value on a variable wich data
> type is Date/Time, if i make a statement like this
>
> Field Data Type
> CPARCAVEDate Date/Time
>
> strCPARCAVEDate = rstFEVV.fields("CPARCAVEDate").value
>
> if strCPARCAVEDate = "" then
> counter = counter + 1
> end if
>
> The value doesnt increment. Do you guys have an idea how to recognize a no
> value
>
> Thanks
> Leo
>
>
>



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-24-2005
Steven Burn wrote:
> IsNull()
> IsEmpty()
> Len()


Since he is dealing with dates, I would add IsDate() to this list.

>
> ASP isn't like VB,


You mean "vbscript isn't like VB"

> so most of the time (depending on what you are
> doing of course), you can switch datatype checks while you go ...
>


I think you meany to say: in vbscript, all variables are Variants, so their
datatypes are not predefined, and vbscript does implicit conversions
depending on the use being made of the data contained in the variable. For
example, if a method expects a string argument, vbscript will implicitly
convert the value being supplied to the method to a string (if possible).
E.G:

myDate = #2005/10/24# 'definitely contains a date
Response.Write myDate

Response.Write expects a string argument, so vbscript converts the date to a
string

>> Im having trouble in storing blank or space value on a variable wich
>> data type is Date/Time, if i make a statement like this
>>
>> Field Data Type
>> CPARCAVEDate Date/Time
>>
>> strCPARCAVEDate = rstFEVV.fields("CPARCAVEDate").value
>>
>> if strCPARCAVEDate = "" then
>> counter = counter + 1
>> end if
>>


Steven's advice will work for you. I was just adding some additional
information.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
Steven Burn
Guest
Posts: n/a
 
      10-24-2005
Bob,
hehe, cheers for the AI (was trying to keep it simple, lol).

.... and yep.. meant VBScript ;o) (tend to class 'em as virtually the same
thing personally - saves confusion for people I'm talking to, lol)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Bob Barrows [MVP]" <> wrote in message
news:#...
> Steven Burn wrote:
> > IsNull()
> > IsEmpty()
> > Len()

>
> Since he is dealing with dates, I would add IsDate() to this list.
>
> >
> > ASP isn't like VB,

>
> You mean "vbscript isn't like VB"
>
> > so most of the time (depending on what you are
> > doing of course), you can switch datatype checks while you go ...
> >

>
> I think you meany to say: in vbscript, all variables are Variants, so

their
> datatypes are not predefined, and vbscript does implicit conversions
> depending on the use being made of the data contained in the variable. For
> example, if a method expects a string argument, vbscript will implicitly
> convert the value being supplied to the method to a string (if possible).
> E.G:
>
> myDate = #2005/10/24# 'definitely contains a date
> Response.Write myDate
>
> Response.Write expects a string argument, so vbscript converts the date to

a
> string
>
> >> Im having trouble in storing blank or space value on a variable wich
> >> data type is Date/Time, if i make a statement like this
> >>
> >> Field Data Type
> >> CPARCAVEDate Date/Time
> >>
> >> strCPARCAVEDate = rstFEVV.fields("CPARCAVEDate").value
> >>
> >> if strCPARCAVEDate = "" then
> >> counter = counter + 1
> >> end if
> >>

>
> Steven's advice will work for you. I was just adding some additional
> information.
>
> Bob Barrows
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-24-2005
Steven Burn wrote:
> Bob,
> hehe, cheers for the AI (was trying to keep it simple, lol).
>
> ... and yep.. meant VBScript ;o) (tend to class 'em as virtually the
> same thing personally - saves confusion for people I'm talking to,
> lol)
>

.... except for the ones using jscript in their server-side code
--
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.


 
Reply With Quote
 
Steven Burn
Guest
Posts: n/a
 
      10-24-2005
rofl yep.... 'cept I don't use that one personally ;o)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Bob Barrows [MVP]" <> wrote in message
news:...
> Steven Burn wrote:
> > Bob,
> > hehe, cheers for the AI (was trying to keep it simple, lol).
> >
> > ... and yep.. meant VBScript ;o) (tend to class 'em as virtually the
> > same thing personally - saves confusion for people I'm talking to,
> > lol)
> >

> ... except for the ones using jscript in their server-side code
> --
> 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.
>
>



 
Reply With Quote
 
leo
Guest
Posts: n/a
 
      10-25-2005
Thanks guys this is really a great help

thaaankssss...

"Steven Burn" <> wrote in message
news:#...
> rofl yep.... 'cept I don't use that one personally ;o)
>
> --
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> www.it-mate.co.uk
>
> Keeping it FREE!
>
> "Bob Barrows [MVP]" <> wrote in message
> news:...
> > Steven Burn wrote:
> > > Bob,
> > > hehe, cheers for the AI (was trying to keep it simple, lol).
> > >
> > > ... and yep.. meant VBScript ;o) (tend to class 'em as virtually the
> > > same thing personally - saves confusion for people I'm talking to,
> > > lol)
> > >

> > ... except for the ones using jscript in their server-side code
> > --
> > 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.
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
type(d) != type(d.copy()) when type(d).issubclass(dict) kj Python 5 12-26-2010 06:48 PM
#define ALLOCIT(Type) ((Type*) malloc (sizeof (Type))) Yevgen Muntyan C Programming 10 02-13-2007 02:52 AM
Re: Type casting- a larger type to a smaller type pete C Programming 4 04-02-2004 05:19 PM
Re: Type casting- a larger type to a smaller type heyo C Programming 3 04-01-2004 06:35 PM
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. luna ASP .Net 1 02-13-2004 01:15 PM



Advertisments