same date this year

BeliasBelias Member Posts: 2,998
Is there a better way to do this?
IF DMY2DATE(DATE2DMY(TBBaseCal.Date,1),DATE2DMY(TBBaseCal.Date,2),DATE2DMY(TODAY,3)) = TODAY THEN

I'm trying to transform a date from, for example, 12/02/03 to 12/02/08...
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Answers

  • krikikriki Member, Moderator Posts: 9,110
    IF (DATE2DMY(TBBaseCal.Date,1) = DATE2DMY(TODAY,1)) AND
        (DATE2DMY(TBBaseCal.Date,2) = DATE2DMY(TODAY,2)) THEN
    

    Well, the IF is still complicated, but it is more clear what you want to do.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • BGIBGI Member Posts: 176
    Maybe something like this:
    IF CALCDATE('<+1Y>',TBBaseCal.date) = today then...
    
    Rgds
    Benny Giebens
  • BeliasBelias Member Posts: 2,998
    sure...so you think that dmy2date and date2dmy is the only way... :cry:
    if anyone have other ideas they're welcome...
    for now...thanks kriki...this is better than my "if" 8)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • BeliasBelias Member Posts: 2,998
    BGI wrote:
    Maybe something like this:
    IF CALCDATE('<+1Y>',TBBaseCal.date) = today then...
    

    right...if i know the nuber of years between the dates...but i don't know it...i can calculate it but the complication will remain the same :D
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • DenSterDenSter Member Posts: 8,305
    Belias wrote:
    sure...so you think that dmy2date and date2dmy is the only way... :cry:
    if anyone have other ideas they're welcome...
    Is there a problem with that solution? It appears that you don't like this solution and I'm curious why.
  • BeliasBelias Member Posts: 2,998
    i wasn't satisfied by my solution...kriki's one is far better than mine.
    I was only wondering if there were something different with date table or whatever else...in order to learn something new :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • krikikriki Member, Moderator Posts: 9,110
    As (almost) always : there are multiple solutions.
    Some more beautiful than others. Some better, some less. But mostly these depend on the tastes of the programmers.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • BeliasBelias Member Posts: 2,998
    kriki wrote:
    As (almost) always : there are multiple solutions.
    Some more beautiful than others. Some better, some less. But mostly these depend on the tastes of the programmers.
    :mrgreen: right!and whatever method you use, you can [solve] your problem!
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.