StrToDate('26-12-2015'); does not work ...?
Hi,
im working on a Delphi based report. Later the Programm will Hand over a Var called "DatumMontag" with a Notation like this 26-12-2015.
For testing purposes this var has been set in the Code as '''26-12-2015''' (in the way it will be hand over later aswell)..., however the StrToDate() function does not work properly and i got an error Message with " ... 'DatumMontag' is no valid date "
I think im doing it wrong somehow...
what should i do to correct it?
Well thats the easy part so far i think... later i will need to add 6 Days to this Date too. in my first attempts i successed adding days to this Date BUT when i add 6 Days to the 26-12-2015 i get 32-12-2015 instead of 01-01-2016 ...
can someone pls explain how to do this like intended..
Ty!
im working on a Delphi based report. Later the Programm will Hand over a Var called "DatumMontag" with a Notation like this 26-12-2015.
For testing purposes this var has been set in the Code as '''26-12-2015''' (in the way it will be hand over later aswell)..., however the StrToDate() function does not work properly and i got an error Message with " ... 'DatumMontag' is no valid date "
I think im doing it wrong somehow...
procedure GroupHeader1OnBeforePrint(Sender: TfrxComponent);
begin
StrToDate('DatumMontag');
end;
what should i do to correct it?
Well thats the easy part so far i think... later i will need to add 6 Days to this Date too. in my first attempts i successed adding days to this Date BUT when i add 6 Days to the 26-12-2015 i get 32-12-2015 instead of 01-01-2016 ...
can someone pls explain how to do this like intended..
Ty!
Comments
Do as follow : StrToDate(DatumMontag)
Well i have removed those quotes and i now get the "undeclared indentifier: 'DatumMontag'" error...
i've tried a few things and im always landing on that or some similar errors...
Thats how it currently looks like:
To do it as a script variable (the value of this kind of variable are local to the report, they can't be set externally), it would be as following :
i used ur first code snipped and got an "DatumMontag is no valid Date"-error...
well. just to make sure that u know what the final result should look like.. (Damn, cant belive its soo hard to get this simple thing done... [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> ... ) on the Top of the Report Page there will be a certain Date. This Date could be any Monday of a Month and will be Hand over by a SAP-like Program in a notation like this "26-12-2015". The Var has been set via 'Report > Variables' in the top Menu-Band of FR and filled via the Set command with the 26-12-2015 (for testing purposes; it will be out-commented later) in the code. Somehow FR ist not able to recognize this Simple Var written in a Memofield [DatumMontag] ... as an actual Date, so that Format settings are ignored so far,... it could have been sooo easy if that would work... Anyway. Since that does not work im trying to use the StrToDate function which is not able to fix this either it seems..! I really like to skip this Date-Stuff but unfortunately i need this date +6 Days in the Report itself again. Ty[/img]
So this err might be forced by PC settings? :S
I'm not saying to change anything for the long term. Just try it to see if you can make it work.. then we can go and find a solution once we find why the same code snippet work for me and not for you.
Creating simple reports with FR is really Fast but when creating some moderate complex or complex reports, it is very very hard. Often our team members stuck resolving simple calculations and tasks. Struggling with display formats, calculations in scripts, etc. But all these still run Fast. Often it takes quite a lot time for simple tasks even without struggling. Even selecting and changing font, style, display format and some common properties of 7-8 objects will irritate you.