Passes loop no matter date is big or not

B

burcu

Hi,
I am trying to find tasks whose start dates are after their deadline.That
are late works.
I am writing (DateFormat(ActiveCell.Task.deadline, pjDate_ddd_mm_dd) <
DateFormat(Date, pjDate_ddd_mm_dd)) And (ActiveCell.Task.ActualStart = "NA")
Then

.. It passes this condition no matter if deadline is less than today or not.
I don't understand.I don't understand.
pofff
Dim i As Integer
SelectBeginning
For i = 1 To ActiveProject.Tasks.Count
If ActiveCell.Task.deadline <> "NA" Then
If (DateFormat(ActiveCell.Task.deadline, pjDate_ddd_mm_dd) <
DateFormat(Date, pjDate_ddd_mm_dd)) And (ActiveCell.Task.ActualStart = "NA")
Then
For j = 1 To ActiveCell.Task.Resources.Count
govde = govde & ActiveCell.Task.Name &
ActiveCell.Task.Resources(j).Name & ActiveCell.Task.deadline & Chr(13) &
Chr(10)
Next j
End If
End If

SelectCellDown
Next i
a = MailSend("(e-mail address removed)", , "Baþlama Tarihi>Teslim
Tarihi Olan Ýþler", govde, , False)
 
G

Gérard Ducouret

Burcu,

A simple filter could do that without any programming :

Field Name : Finish (instead of Start, I prefer)
Test : Is greater than
Value : [Deadline]
AND
Field Name : Actual Finish
Test : equals
Value : NA

Gérard Ducouret
 
B

burcu

Hi,
The problem's reason is I compare strings instead of dates.But I wonder
where this filter is.
Thanks.

Gérard Ducouret said:
Burcu,

A simple filter could do that without any programming :

Field Name : Finish (instead of Start, I prefer)
Test : Is greater than
Value : [Deadline]
AND
Field Name : Actual Finish
Test : equals
Value : NA

Gérard Ducouret

burcu said:
Hi,
I am trying to find tasks whose start dates are after their deadline.That
are late works.
I am writing (DateFormat(ActiveCell.Task.deadline, pjDate_ddd_mm_dd) <
DateFormat(Date, pjDate_ddd_mm_dd)) And (ActiveCell.Task.ActualStart = "NA")
Then

. It passes this condition no matter if deadline is less than today or not.
I don't understand.I don't understand.
pofff
Dim i As Integer
SelectBeginning
For i = 1 To ActiveProject.Tasks.Count
If ActiveCell.Task.deadline <> "NA" Then
If (DateFormat(ActiveCell.Task.deadline, pjDate_ddd_mm_dd) <
DateFormat(Date, pjDate_ddd_mm_dd)) And (ActiveCell.Task.ActualStart = "NA")
Then
For j = 1 To ActiveCell.Task.Resources.Count
govde = govde & ActiveCell.Task.Name &
ActiveCell.Task.Resources(j).Name & ActiveCell.Task.deadline & Chr(13) &
Chr(10)
Next j
End If
End If

SelectCellDown
Next i
a = MailSend("(e-mail address removed)", , "Baþlama Tarihi>Teslim
Tarihi Olan Ýþler", govde, , False)
 
B

burcu

I saw your other mail now. Ok:)
burcu said:
Hi,
The problem's reason is I compare strings instead of dates.But I wonder
where this filter is.
Thanks.

Gérard Ducouret said:
Burcu,

A simple filter could do that without any programming :

Field Name : Finish (instead of Start, I prefer)
Test : Is greater than
Value : [Deadline]
AND
Field Name : Actual Finish
Test : equals
Value : NA

Gérard Ducouret

burcu said:
Hi,
I am trying to find tasks whose start dates are after their deadline.That
are late works.
I am writing (DateFormat(ActiveCell.Task.deadline, pjDate_ddd_mm_dd) <
DateFormat(Date, pjDate_ddd_mm_dd)) And (ActiveCell.Task.ActualStart = "NA")
Then

. It passes this condition no matter if deadline is less than today or not.
I don't understand.I don't understand.
pofff
Dim i As Integer
SelectBeginning
For i = 1 To ActiveProject.Tasks.Count
If ActiveCell.Task.deadline <> "NA" Then
If (DateFormat(ActiveCell.Task.deadline, pjDate_ddd_mm_dd) <
DateFormat(Date, pjDate_ddd_mm_dd)) And (ActiveCell.Task.ActualStart = "NA")
Then
For j = 1 To ActiveCell.Task.Resources.Count
govde = govde & ActiveCell.Task.Name &
ActiveCell.Task.Resources(j).Name & ActiveCell.Task.deadline & Chr(13) &
Chr(10)
Next j
End If
End If

SelectCellDown
Next i
a = MailSend("(e-mail address removed)", , "Baþlama Tarihi>Teslim
Tarihi Olan Ýþler", govde, , False)
 
Top