FieldRef dates & times

bhalpinbhalpin Member Posts: 309
Hi.

I've done my best in the help and searching this form, but can't quite figure out how to get a date and a time from FieldRefs. I can get the text value with FORMAT, but I need to get the values out of date & time fieldrefs into date & time variables.

Any quick pointers?

Thanks in advance.

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    I'm not sure what you really want to do, but maybe you're searching for EVALUATE?!
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • krikikriki Member, Moderator Posts: 9,110
    RecRef.OPEN(DATABASE::"Log");
    RecRef.findfirst;
    FldRef := RecRef.FIELD(90); // the ID of a date-field
    TheDate := FldRef.VALUE;
    MESSAGE('%1',TheDate);
    

    And it is the same for all other fields.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • bhalpinbhalpin Member Posts: 309
    Yup, and I found the answer:

    EVALUATE(DateVar,FORMAT(DateFieldRef));
    EVALUATE(TimeVar,FORMAT(TimeFieldRef));

    Thanks!
Sign In or Register to comment.