Topic: Covert Date to String
Hi in the picture I send you my problem.
I try to Convert the Date to string. I try it using the FormatToDate or the StrToDate but somewhere I make a mistake. Can someone help me ?
from 2016-3-15 to 15/3/2016.
My Visual Database → General → Covert Date to String
Hi in the picture I send you my problem.
I try to Convert the Date to string. I try it using the FormatToDate or the StrToDate but somewhere I make a mistake. Can someone help me ?
from 2016-3-15 to 15/3/2016.
You can do the following:
String_Date := Formatdatetime('DD/MM/YYYY', Date);
Clicking on a TableGrid it should show in the EditBox the date.
Here is my script
var
s:string;
begin
s := SQLExecute('Select ImerominiaFakelou from Ypothesi WHERE id=' + IntToStr(frmEpilogiYpothesis.TableGrid1.dbItemID));
frmEpilogiYpothesis.Edit2.Text:=s;
end;
the s should have the date
When I give your script it shows the current date and not the date there is in the record.
Where is my mistake?
Thank's in advance
Hello,
I think I would do it this way to save making an extra call to the database, but I am sure there will be other ways to do it too.
******************************************************************************
Var YY,MM,DD : integer; mydate: tdatetime;
procedure whatever_you_want
begin
mydate := form1.DateTimePicker1.datetime;
DeCodeDate (mydate,YY,MM,DD);
form1.edit1.text := inttostr(dd) +'/'+ inttostr(mm) +'/' + inttostr(yy);
end;
******************************************************************************
I have attached this in a little project to show it working.
Maybe it will help,
Derek.
Thank you for your help but this solution is to complex. I 'm sure there must be another way
v_pozidis,
Attached is a possible solution using the method you are trying to do.
Yes this works. !!!!!!!!!!!! Thak's to all of you.
My Visual Database → General → Covert Date to String
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi