convert string to date

DekitoDekito Member Posts: 19
Hi,

Can anyone tell me how can I convert string (text) to date format.
I need it for the following code:

SETRANGE("Posting Date",0D,FORMAT(RequestOptionsForm."Status Date"));
In other words I want to take the current value from the control "Status date" in Request Form.

10x in advance.
Dekito

Answers

  • prakaash786prakaash786 Member Posts: 12
    My advice would be that you should use the Date Data type for the field Status date. and if you want to use the text field then ask users to put information in DDMMYY format and then u can use the function DMY2DATE function with some code.
  • vaprogvaprog Member Posts: 1,139
    RequestOptionsForm."Status Date" is the control, not the value entered there. The value goes to the variable you provided in the SourceExpr property.
    If the variable is of type Date, the system does the conversion without you having to do anything. If you must use a text type use the EVALUATE function to convert a string to whatever datatype you need.
  • chandrurecchandrurec Member Posts: 560
    If you want to convert to text datatype then go for format keyword else if you want to convert from text to any other data then go for evaluate keyword.

    Regards,
    chandru.
Sign In or Register to comment.