Setting shortdateformat global for datetimetostr()
Hello.
I am attempting to set the format for the conversion function
datetimetostr() on a datetime variable. I did enough research to know
that I need to set the shortdateformat variable to 'mm/dd/yyyy' but
don't know where in the calc's tab and/or in what eventhandler to
declare it. I tried doing so in the same routine as the datetimetostr()
is called but the compiler does not seem to recognize (shortdateformat
:= 'mm/dd/yyyy') as anything more than another local variable that
hasn't been declared.
Any help would be appreciated.
Thank you.
JGrubs
I am attempting to set the format for the conversion function
datetimetostr() on a datetime variable. I did enough research to know
that I need to set the shortdateformat variable to 'mm/dd/yyyy' but
don't know where in the calc's tab and/or in what eventhandler to
declare it. I tried doing so in the same routine as the datetimetostr()
is called but the compiler does not seem to recognize (shortdateformat
:= 'mm/dd/yyyy') as anything more than another local variable that
hasn't been declared.
Any help would be appreciated.
Thank you.
JGrubs
This discussion has been closed.
Comments
I'm unclear about what exactly you are trying to accomplish. If you are
converting a datetime field to a string, it should return the entire
DateTime including the time. Are you trying to determine what display
format you need for the outputed string?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I need to keep the leading zero in front of the date. In it's present
format the string is being created with no leading zeros. To ensure it
does the function needs to have the format change and in this case that
is the 'mm/dd/yyyy' as compared to it's present format of 'm/d/yyyy.'
Does this help? Sorry for not communicating this fact earlier.
Thank you for your help on this matter.
The DateTimeToStr Delphi routine does not support the addition of a format
however the DateTimeToString Delphi routine does. This however is not
natively included with RAP so you would need to create a pass-thru function
to expose this capability. A full example of how to create a pass-thru
function is available in the ReportBuilder Developer's Guide located in the
\RBuilder\Developer's Guide\... directory or there are examples located in
the \RBuilder\Demos\0. RAP\... directory.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com