Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ms Project passes the loop whether date is big or not 1

Status
Not open for further replies.

tzigone

MIS
Aug 11, 2003
42
TR
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("burcu.kagnici@introsolutions.com", , "Baslama Tarihi>Teslim Tarihi Olan Isler", govde, , False)
 
How are ActiveCell incremented ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi tzigone,

Your problem is that you are comparing STRINGS, not dates.

The string "Fri 27/02", for example, is less than the string "Tue 24/04". You don't want to be formatting the dates, so just use ..

Code:
[blue]If ActiveCell.Task.deadline < Date And ...[/blue]

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top