How to format birt date report parameter? - birt

By default if the input parameter to BIRT report is of type Date, it takes yyyy-MM-dd format.
Can we change to something else e.g. may be dd/MM/yyyy ?

You can change the input format for a date parameter. Click on "Change..." select Format as "Custom" and you can enter a valid format code as you like.
If you want to enter a default Date you still have to use the yyyy-MM-dd Format, this cannot be changed ( where I used new Date() in the Picture), but the output format will still be your entered format.

Another option is to use the format Date Time section in the Birt designer and choose the right locale and formatting for the date.
I have done it in Birt 3.7 and works fine

There can be many way to do that but the easy one is you can do this in SQL Query itself.
If you are using DB2 you may try
VARCHAR_FORMAT("Your Column Mapping Name",'DD-Mon-YYYY') AS dataSetName.
But this will change its Data type to String
Try if this make any seance.

Related

Changing format of date without using to_char - Oracle

I have to get the max payment date on an invoice and I am having trouble with the date format. I do not need the max in this formula as I am using the format in a reporting tool that is pulling the max from what it finds for me.
Using "to_char({datefield},'mm/dd/yyyy')" works for displaying that date the way we would like BUT when you use summary function MAX it does not pull the correct date because it is looking at a string and not a date (it will think 12/3/21 is larger than 3/2/22).
Another thing I have tried is trunc - "trunc({datefield})" which gives us the correct max date but it changes the formatting. For example if the date prior to the formula being applied is "8/12/21 12:00:00:000" the trunc formula will display it as 12-08-21 which is horribly wrong.
Long story short is I need a way to change a date/time to date with the format of 'mmmm/dd/yyyy' WITHOUT converting it to a string with something like to_char. Thank you!!!!
A DATE is a binary data type consisting of 7 bytes representing: century, year-of-century, month, day, hour, minute and second. It ALWAYS has all of those components and it is NEVER stored with any (human-readable) format.
What you are seeing when a date is displayed is the client application you are using to access the database making a decision to be helpful to you, the user, and display the binary DATE provided by the database in a human-readable format.
If you want to change how the DATE is displayed then you either need to:
Change the settings on the client application that controls how it formats dates when it displays them to you; or
Change the data-type so that it is no longer a DATE (which does not have a format) to a data type where the values of the date can be formatted (such as a string). You can do this using TO_CHAR.
If you want to find the maximum then do it BEFORE applying the formatting:
SELECT TO_CHAR(MAX({datefield}),'mm/dd/yyyy')
FROM your_table;

Formatting a date column in powerpointwriter

I am using PowerpointWriter to populate a ppt table. I have currency and date columns that need to be formatted (not with colors/fonts/etc). For example, the date column needs to be the date only, not the time.
How do I do this?
Thanks,
Cheri
PowerPointWriter does not support that kind of formatting at the moment. You should consider formatting your data in your application before binding the data to the PowerPoint file using PowerPointWriter..

How to change DTPickers date format to yyyy/mm/dd?

i tried this in form load event :
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "yyyy/MM/dd"
That didnt work.
when i saved it to my database, it turned into dd/mm/yyyy.
I tested it with a textbox, i sent the value to a textbox, it gave me the same dd/mm/yyyy.
Is there any way to do this?
The standard format of Date field type in databases is normally:
MM/DD/YYYY HH:NN:SS
(Unless expressly indicated, where database allows to set a different format); this is depend from database type.
I.e. Access doesn't allows to store date on other formats.
You must set the custom format after load data using Format() function:
Text1.Text = Format$(YourRecordset!YourData, "yyyy/MM/dd")

CDate can't convert from string dd/MM/yyyyy in Report

06/07/2559 < this is dd/MM/yyyy
This is ok for converting but CDate convert to this format MM/dd/yyyy
If I use this
30/06/2559 I'll get error because CDate think 30 is a month.
Anyway to convert my string dd/MM/yyyy to Date in Report?
Thanks in advance
Three ways/things that you can do to achieve this -
You can set the localisation format at the report level which means you don't have to use the format function every time you drop a date on to the report.
You can covert the string to your required format ('mm/dd/yyyy' or 'dd/mm/yyyy') in database itself. For your reference in MSSQL you can do it like this -
You can format (use FORMAT() function) your code in SSRS itself somewhat like below -
On that field change attibute Language to es-Es (or any other country that uses dd/MM/yyyy format)

Datetime Format Setting In SSRS

We have a requirement where date time values would be passed to the report parameter which is of "String" date type (and not "DateTime"). The report parameter would be a queried one i.e. it would have a list of values in which the passed value should fall in.
The strange part is that if the date time value passed to this parameter is passed in this format mm/dd/yyyy hh:mm:ss AM/PM then only it succeeds otherwise a error is displayed (If month/date/hour/minute/second is having a single digit value then we need to pass single digit value to parameter as well).
Assuming that the report server picks this format from the "regional settings" in control panel, we tried modifying the date & time formats as yyyy-mm-dd & HH:mm:ss but the outcome was the same.
On researching more I found some suggestions specifying to change the language property in the rdl (I was not able to figure out how) but this would not be the solution I am looking for. I also found another topic here but it didn't provide the solution we are looking for.
I need to understand if this format is controlled at the report server level & is it configurable. It would be great if someone can provide some guidance.
Thanks.
Format(,"mm/dd/yyyy hh:mm:ss AM/PM ")
Then it doesn't matter what the regional settings are.

Resources