Day Count

Cringer

ProgressTalk.com Moderator
Staff member
I don't understand what you want to do. How many days since the 1st of Jan it is? So 1st Jan is day 1, 2nd Jan is day 2, etc? If that's what you want, then try this.
Code:
DEFINE VARIABLE lvDate AS DATE     NO-UNDO.

lvDate = TODAY.

MESSAGE (lvDate - DATE(1,1,YEAR(lvDate)) + 1)
  VIEW-AS ALERT-BOX INFO BUTTONS OK.
 

atuldalvi

Member
No. My problem is suppose today is 23rd so i want the count or number of this day out of 365 days.

like 70 80 90 etc.
 

Cringer

ProgressTalk.com Moderator
Staff member
I still don't understand because that sounds exactly like what I said: If today is the 2nd of January then it is day 2 of 365?
 

sdjensen

Member
Code:
def var d as date.
d = today.
def var d2 as date.
d2 = date(01,01,2011).

message d - d2 + 1.
If run today, it gives 178.
 

Cringer

ProgressTalk.com Moderator
Staff member
Essentially what I posted above, but mine will work for any date in any year.
 
Top