|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DateDiff ErrorCan anyone see a problem with the code below. The DateDiff section is
getting an error: Overload resolution failedbecause no accessible "DateDiff" can be called without a narrowing conversion. If strEndDate <> strBegDate Then Dim strDiff As Long = DateDiff(DateInterval.Day, strBegDate, strEndDate) End If Thanks in Advance :) Elena wrote:
> Can anyone see a problem with the code below. The DateDiff section is Try converting your String to Date types. That should clear up your issues.> getting an error: Overload resolution failedbecause no accessible "DateDiff" > can be called without a narrowing conversion. > > If strEndDate <> strBegDate Then > Dim strDiff As Long = DateDiff(DateInterval.Day, strBegDate, > strEndDate) > End If > > Thanks in Advance :) Chris "Elena" <El***@discussions.microsoft.com> schrieb: Either use 'DateDiff(DateInterval.Day, CDate(strBegDate), CDate(strEndDate)' > Can anyone see a problem with the code below. The DateDiff section is > getting an error: Overload resolution failedbecause no accessible > "DateDiff" > can be called without a narrowing conversion. > > If strEndDate <> strBegDate Then > Dim strDiff As Long = DateDiff(DateInterval.Day, strBegDate, > strEndDate) > End If or specify '"d"' instead of 'DateInterval.Day'. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Why use Events?
[Datable] change column datatype ownerdraw menu, help appreciated VB6 - Unable to read Text File Custom collections Best way to get the value of one particular node of an XML string Crystal Report Database Change iHttpModule and Virtual Directories Application class problem Create common functions library |
|||||||||||||||||||||||