|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
converting Date to longIn 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" <BrianSha***@discussions.microsoft.com> schrieb Use the object's methods:> 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? > Dim diff as timespan diff = userdate.subtract(mydate) Then access the Timespan's members. Armin Thanks, worked great
Show quoteHide quote "Armin Zingler" <az.nospam@freenet.de> wrote in message news:uP7C5cyMGHA.668@TK2MSFTNGP11.phx.gbl... > "Brian Shafer" <BrianSha***@discussions.microsoft.com> schrieb >> 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 |
|||||||||||||||||||||||