Sign in to follow this  
Followers 0
b0ris

Compare dates

4 posts in this topic

I've already checked the forum, but found nothing useful on comparing 2 dates.

What I'm trying to do, is getting a lot of dates from a database using SQL, then check if those are between a start date and an end date I'm entering.

Does any of you got any idea how to do this?

Thanks in advance for any help!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Did you have a look at the Date Management UDF? See: Help File -> User Defined Functions -> Date Management.

Function _Date_Time_CompareFileTime could do what you want.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Did you have a look at the Date Management UDF? See: Help File -> User Defined Functions -> Date Management.

Function _Date_Time_CompareFileTime could do what you want.

Thanks for trying to help, but that won't work, or at least I'm not good enough to make it work.

The code looks like this now:

$aMon=StringMid($tAssigned[$x],4,2)
$aDay=StringLeft($tAssigned[$x],2)
$aYear=StringMid($tAssigned[$x],7,4)
$dateASS=_Date_Time_EncodeFileTime($aMon,$aDay,$aYear)
$sMon=StringMid($sDate,4,2)
$sDay=StringLeft($sDate,2)
$sYear=StringMid($sDate,7,4)
$sDate1=_Date_Time_EncodeFileTime($sMon,$sDay,$sYear)
$eMon=StringMid($eDate,4,2)
$eDay=StringLeft($eDate,2)
$eYear=StringMid($eDate,7,4)
$eDate1=_Date_Time_EncodeFileTime($eMon,$eDay,$eYear)
$date1X=_Date_Time_CompareFileTime($dateASS,$sDate1)
$date2X=_Date_Time_CompareFileTime($dateASS,$eDate1)
If ($date1X=0 Or $date1X=1) And ($date2X=0 Or $date2X=-1) Then
    If $tOpCo[$x] = $targetOC Then
        ReDim $xx00[$vXXrow + 1][9]
        $xx00[$vXXrow][0] = $tLog[$x]
        $xx00[$vXXrow][1] = $tStat[$x]
        $xx00[$vXXrow][2] = $tStatus[$x]
        $xx00[$vXXrow][3] = $tType[$x]
        $xx00[$vXXrow][4] = $tComment[$x]
        $xx00[$vXXrow][5] = $tPendDate[$x]
        $xx00[$vXXrow][6] = $tAssigned[$x]
        $xx00[$vXXrow][7] = $tRecords[$x]
        $xx00[$vXXrow][8] = $tRecvd[$x]
        $vXXrow = $vXXrow + 1
    EndIf
EndIf

Share this post


Link to post
Share on other sites

Okay, after the second look, I found that I forgot to use DllStructGetPtr.

Now it works, thanks for the help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0