PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Reporting - Dates
Reporting - Dates
Débuté par Milton Kirkwood, 12 oct. 2005 09:44 - 2 réponses
Posté le 12 octobre 2005 - 09:44
Hi,
I am having trouble when using dates in a report because they do not print out in the required format. In the analysis I specified a date with entry mask DD/MM/YYYY and returned value as DDMMYYYY. For example, I entered 30th September 2005 as 30/09/2005 and it shows that way in the data entry form. When it prints out in a report it prints as 05/20/3009. I have tried various DateToString and StringToDate conversions but to no avail. I did get it working using the following code by setting global variables
Day is int
Month is int
Year is int
NewDate is string
and then using
Day=RequestDate
Month=RequestDate
Year=RequestDate
and constructing a date from thisusing -
NewDate=NumToString(Day,"02d")+NumToString(Month,"02d")+NumToString(Year,"4d")
DateRequired=NewDate
Although it worked it seems a difficult way to get a report to print a date as DD/MM/YYYY.
Can anyone help please?
Milton
Posté le 12 octobre 2005 - 12:42
Hello Milton,
Search in the archive with 'dates'. Then you get e.g. http://f16.parsimony.net/forum28986/messages/19496.htm
Maybe this is the solution : Set the returned value to YYYYMMDD instead of DDMMYYYY)
HTH a little bit,
Teun.
Hi,
I am having trouble when using dates in a report because they do not print out in the required format. In the analysis I specified a date with entry mask DD/MM/YYYY and returned value as DDMMYYYY. For example, I entered 30th September 2005 as 30/09/2005 and it shows that way in the data entry form. When it prints out in a report it prints as 05/20/3009. I have tried various DateToString and StringToDate conversions but to no avail. I did get it working using the following code by setting global variables
Day is int
Month is int
Year is int
NewDate is string
and then using
Day=RequestDate
Month=RequestDate
Year=RequestDate
and constructing a date from thisusing -
NewDate=NumToString(Day,"02d")+NumToString(Month,"02d")+NumToString(Year,"4d")
DateRequired=NewDate
Although it worked it seems a difficult way to get a report to print a date as DD/MM/YYYY.
Can anyone help please?
Milton
Posté le 14 octobre 2005 - 00:07
Thanks Teun for your assistance.
Milton
Hello Milton,
Search in the archive with 'dates'. Then you get e.g. http://f16.parsimony.net/forum28986/messages/19496.htm
Maybe this is the solution : Set the returned value to YYYYMMDD instead of DDMMYYYY)
HTH a little bit,
Teun.
Hi,
I am having trouble when using dates in a report because they do not print out in the required format. In the analysis I specified a date with entry mask DD/MM/YYYY and returned value as DDMMYYYY. For example, I entered 30th September 2005 as 30/09/2005 and it shows that way in the data entry form. When it prints out in a report it prints as 05/20/3009. I have tried various DateToString and StringToDate conversions but to no avail. I did get it working using the following code by setting global variables
Day is int
Month is int
Year is int
NewDate is string
and then using
Day=RequestDate
Month=RequestDate
Year=RequestDate
and constructing a date from thisusing -
NewDate=NumToString(Day,"02d")+NumToString(Month,"02d")+NumToString(Year,"4d")
DateRequired=NewDate
Although it worked it seems a difficult way to get a report to print a date as DD/MM/YYYY.
Can anyone help please?
Milton