-
formating a date
I have a date field coming from a mysql database. However prd sees it as a string and shows it in the format of yyyy-mm-dd hh:mm:ss
I would like to reformat this date, but when i morph to a date field it shows blank
also i tried morning to a message format and using the $(mydate, date, MMMM dd, yy)
That does not work either. Any suggestions?
-
Is the field actually a Date - so is the column in MySQL declared as either a Timestamp or Date field? (You can see the type of the field in parentheses after the field name in the data-tree in PRD.)
If not, then you would have to parse the date-string into a real Date before you can work with it. For that, use either the "Convert To Date" function or if you use PRD 3.6, then use the formula
=PARSEDATE([your-date-column], "yyyy-MM-dd")
to convert your text into a usable date object that can be displayed by the Date-field.
-
try to use a function in the sql query like
cast( datefield as date) ... or right(datefield, 9) or something like that
hope it helps you
-
Turns out i was running another report where morphing to a date works perfectly.
The only difference with the 2 reports is that the one that does not work, the query is dynamically generated by a stored procedure, where as the other is a straight call to a table. (still nested in a stored procedure.)
As a temporary fix i formatted the date from the stored procedure side.
Im using prd 3.5 so could not try Taqua's solution
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules