Autor Beitrag
Barret
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 156
Erhaltene Danke: 1

Win XP
D7 Ent
BeitragVerfasst: Mi 15.06.05 13:27 
Hi Leute!
Ich hab nen DateTimePicker und eine MySql-Datenbank.
Jetzt möchte ich das Datum was in der DB (yyyy-mm-dd) steht in den Picker(dd.mm.yyyy) eintragen. Ich komm aber partu nicht weiter. Wenn ich das Date auslese und in ein Label packe geht alles wunderbar aber mit dem Picker ....
Für die Labels form ich das Format einfach an den entsprechenden Stellen um. Ungefähr so
ausblenden Delphi-Quelltext
1:
ShortDateFormat := 'dd.mm.yyyy';					

und dan is es ja nur noch eine einfache Zuweisung
ausblenden Delphi-Quelltext
1:
Label.Text := Query.FieldByName('Spalte').AsString;					


Kann mir jemand erklären wie ich es bei einem Picker anstelle???

mfg

_________________
Wir könnten ja, wenn wir wollten aber wir wollen ja nicht.
It´s not a bug, it´s a feature.
neojones
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1206
Erhaltene Danke: 1



BeitragVerfasst: Mi 15.06.05 13:36 
Form das Format mit DATE_FORMAT schon am Server um und übergebs dann an den DateTimePicker:

ausblenden Quelltext
1:
DateTimePicker1.Date := StrToDate(MeineTabelle.FieldByName('meinfeld').AsString);					


Gruß,

Matthias

_________________
Ha! Es compiliert! Wir können ausliefern!
Barret Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 156
Erhaltene Danke: 1

Win XP
D7 Ent
BeitragVerfasst: Mi 15.06.05 14:21 
@ neojones: danke!!! funktioniert alles reibungslos

_________________
Wir könnten ja, wenn wir wollten aber wir wollen ja nicht.
It´s not a bug, it´s a feature.
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mi 15.06.05 14:23 
Hallo,

folgendes müsste eigentlich auch funktionieren und ich spare mir die Typumwandlung:
ausblenden Delphi-Quelltext
1:
DateTimePicker1.Date:=MeineTabelle.FieldByName('meinfeld').AsDateTime;					

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)