converting Date to long

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In vb 6 i had a something like result = CLng(UserDate) - CLng(MyDate)
in vb.net I get an error
"Value of tyep 'Date' cannot be converted to 'Long'.

How do i get around this?
 
Brian Shafer said:
In vb 6 i had a something like result = CLng(UserDate) -
CLng(MyDate) in vb.net I get an error
"Value of tyep 'Date' cannot be converted to 'Long'.

How do i get around this?

Use the object's methods:

Dim diff as timespan

diff = userdate.subtract(mydate)


Then access the Timespan's members.


Armin
 
Thanks, worked great


Armin Zingler said:
Use the object's methods:

Dim diff as timespan

diff = userdate.subtract(mydate)


Then access the Timespan's members.


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top