Column in DATE format
Hello Everybody
I have a report did Apex, this report has a column which data type is DATE but by default the Apex put it in the format : DD-MM-YYYY HH:MI:SS
But I only want that his column has the format DD/MM/YYYY
I know that is posible convert this field using the function TO_CHAR(date, format) but in the report I want to sort this field considering that this filed is in date data type not in char.
Also I know that I can use the function EXTRACT for concatening the day, month and year and after convert to date in the format 'dd/mm/yyyy'; but I don´t want to write many code.
I don't want to do some like this:
TO_DATE(
EXTRACT( 'DAY' FROM DateFiled )||'/'|| EXTRACT( 'MONTH' FROM DateFiled )||'/'|| EXTRACT( 'YEAR' FROM DateFiled ), 'DD/MM/YYYY' )
Do you know how to convert to this date format (DD/MM/YYYY) preserving the format?
I expect your prompt reply.
Any help will be very appreciated.
Best Regards
Hi Eric
One of the really cool features of the later versions of APEX is the ability to set a default "Application Date Format".
This is done in the Application xx>Shared Components>Definition then select the "Globalization" tab.
You can select from a list of pre-defined date formats, or enter your own.
My preference is "DD-Mon-YYYY" which is not in the list.
Just leave your date fields as regular DATE type in the select (no formatting in the select).
This Application Date Format is then used as the default for ALL dates for which you don't specifically set (another) date format
This is also selecable in the Display options of a "Date Picker (Use Application Date Format)" LOV - for any date page items that you want to provide a date picker.
This really simplifies the effort in getting a consistent look and feel - and keeping a constant standard throughout the application.
The other benefit is that you can make a change in one place, and ALL the dates (without a specific date format specification) will change format - just like that.
This is just one of the features that makes APEX the most productive - and cool - systems around.
Enjoy!
Mike
Similar Messages
-
InputDate Column Filter Date Format Problem
Hi,
I have an af:table with filterable columns and some of these columns are based on Timestamp VO attributes.
When I enter a date filter - either manually or from the associated date picker, the filter is applied correctly using a date format of dd/MM/yyyy.
However, when the table is subsequently refreshed, the filter value is still present but has been re-formatted to "yyyy-MM-dd hh:mi:ss" format (default format for a Timestamp datatype?). The an error appears in the column filter component - "Error: The date is not in the correct format".
If I want to retain the filter value across queries, how can this be achieved?
My table column is defined as follows:
<af:column sortProperty="#{bindings.ViewDataVO1.hints.LastReadingDate.name}"
filterable="true" sortable="true"
headerText="#{bindings.ViewDataVO1.hints.LastReadingDate.label}"
id="c59"
rendered='#{bindings.ViewDataVO1.hints.LastReadingDate.displayHint != "Hide"}'
displayIndex="#{bindings.ViewDataVO1.hints.LastReadingDate.displayHeight}">
<f:facet name="filter">
<af:inputDate value="#{vs.filterCriteria.LastReadingDate}" id="id4">
<af:convertDateTime
pattern="#{bindings.ViewDataVO1.hints.LastReadingDate.format}"/>
</af:inputDate>
</f:facet>
<af:outputText value="#{row.LastReadingDate}" id="ot59">
<af:convertDateTime pattern="#{bindings.ViewDataVO1.hints.LastReadingDate.format}"/>
</af:outputText>
</af:column>I've tried messing with the properties of the af:convertDateTime component, but I'm thinking the problem is in the population of the filter facet inputDate with the vs.filterCriteria.LastReadingDate value. This does not appear to be re-formatted for display - but I don't know how to manipulate this value...
Or is there a better way? This seems more complicated than it should be...?
By the way, I am using JDeveloper 11.1.2.1.0 for my development.
Thanks.Does it work fine if you change the pattern for convertDateTime?
I.e
change
<f:facet name="filter">
<af:inputDate value="#{vs.filterCriteria.LastReadingDate}" id="id4">
<af:convertDateTime
pattern="#{bindings.ViewDataVO1.hints.LastReadingDate.format}"/>
</af:inputDate>
</f:facet>to
<f:facet name="filter">
<af:inputDate value="#{vs.filterCriteria.LastReadingDate}" id="id4">
<af:convertDateTime
pattern="dd/MM/yyyy"/>
</af:inputDate>
</f:facet>-Arun -
NEED ALTER TABLE ALTER COLUMN FOR DATE FORMAT
Need something like this :
ALTER TABLE ABC
ALTER COLUMN DATE1 AS (DD/MM/YYYY)
need to appear in this format (29/03/2014) in the table.
also needs to be recorded in DB in that format.changed system date format, works. Thanks!
You should always store values as dates itself in date/datetime related field in SQLServer
The formatting can very easily be done in your front end (presentation layer) using format function
Even in T-SQL you can use CONVERT or FORMAT functions to get the date values in the format you want
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page
I don't follow you? Anyway, Olaf Helper's answer was the solution.
SQL Server has a data type called DATETIME. To correctly query dates, it is easier to use this as it allows the SQL engine to do all the calculations for you, also the canonical format for dates in any database language is YYYY-MM-DD, this ensures correctly
tiered dates that are stored in the right order. The way you store data and the way you display it should be kept as two seperate entities. This is the ISO standard and has been thoroughly investigated ...alot to say the least. This is where the term "front-end"
and "back-end" developers come from, and also the distinction between server-side and client-side scripting.
To cut a long story short, take the advice of the multiple professionals here, and follow standards otherwise you'll find yourself stuck, or worse, your legacy code will make someone tear their hair out. -
Column properties data format save option
Hello,
When I am in Answers, I choose a column, then I click on column propoerties (icon with a hand), data format tab, here I only have the save option when I am with the Administrator user. Is it possible to have this option with another user ? I have tested to create a user which belongs to the Administrator group, but I can't see this option.
Thanks in advance for your help;hi
this is possible, by assigning the user to presentation server administrators group in the answers.
1. login with administrator and click on settings > administration
2. go to Manage Presentation Catalog Groups and Users
3. click on edit properties for existed Presentation server administrators group
4. Click on Add New Member
5. click Show users and Groups appears in the add member window (note: to appear that user in this list, you must login answers with that user at least once)
6. Click on add option provided corresponding to that user you wanted
7. Click Finished
Now you check with the other user login.. you will see the save option -
XML Publisher - how to make column as date format in excel output
Hi,
I am having a XML publisher report , output is excel format. There are some date fields in reports, which are being displayed as "General" type in excel.
Any way to restrict it in Date type only.
Please explain the solution in detail. I am using rtf template.
Regards
SandeepHi Sandeep,
I have the same issue. After looking at a lot of replies from various blogs, some suggest to use this format in your rtf.It did not work for me. You could try this and check if it works for you.
<?format-date:datefied;’yyyy/MM/dd’?> where the format can be specific to your use. -
Convert Creationtime column to date format in table cwsys.cw_workspaces_tab
How to convert the creationtime column value to date in the table cwsys.cw_workspaces_table using sql or otherwise.
-TarunI'm pretty interested in this one as several reports can be created using this field, any inside help??
-
Averaging column with date/time format in BI Answer
Hi everyone
we are working on BI answer and training to get the average of the working hours of the departments. The Working Hrs column is Date format in the Database so we tried to converted to CHAR through Cast Function from Edit columns Formula in Answers BI, and this gave us date "2007/09/01" as result!! We also tried to cast the Working hours to:
CAST(WORKING HOURS AS CHARACTER FORMAT 'yyyyMMdd-HHmmss')
NOTE: In the Working Hours we have null values...
the actual working hours appear in Answer Table is "7/1/2009 6:13:00 AM"
How to get the Working Hours column Average on Answer BI?
Appreciate your help
Regards
Edited by: user817525 on Jul 21, 2009 11:15 PMhow about next solution:
60 * EXTRACT( HOUR FROM ATTENDANCES.A_ATT_TIME) + EXTRACT( MINUTE FROM ATTENDANCES.A_ATT_TIME)
with this u have minutes for working day. If u divide this expression with 60:
(60 * EXTRACT( HOUR FROM ATTENDANCES.A_ATT_TIME) + EXTRACT( MINUTE FROM ATTENDANCES.A_ATT_TIME)) / 60
u now have hour with decimal (for 8:52 is (8*60+52)/60 = 8,67 )
and u only need to round this number.I hope this help
ps.when u have new question probably is good way to create new thread
all best
Phenix
Edited by: Phenix on Aug 5, 2009 8:01 AM -
XML Publisher to Excel Report : Date format problem
Hi,
I am trying to create an Excel report with XML Publisher. I have an issue with the Date Fomatting.
In the XML template, I have set the "Date" column in date format. But the excel output report "Date" column returns as "General text" (string) and it is sorted as text, not as date.
Can anyone please help me out?
Thanks!!!Hi,
Did this post solve your problem? I have the same issue that I need to solve.
I have an xsl-fo template with dates in it.
The dates are in english.
My excel is setup to use danish.
When I export to excel it knows the month jan, feb, mar, apr, ... which are the same in danish and english.
But months where it differs like may (danish maj) the cell is a general text instead of date.
Is there anyway you can set/transform the date in the xsl-fo template so it does not care about the language in excel?
Thank you in advance.
BR Kenneth -
No. of hours appear in Date Format in Reports
The output of the Personnel Action Report shows the "Annual Working Hours" column in Date format. This is the same with other reports like the Wage Type Reporter.
Can somebody suggest a solution to this?
Thanks
RSHey thanks to both of you for responding.
Personnel Action Report is customised "ZHRPA" and Wage type report is also a customised one.
Ameet, could you please let me know what exactly I am supposed to chekc in my parameters (SU3)? Should I ask the developer to check the report since this is a customised one?
Remi, wage type reporter is also a customised report here. It is the customised version of PC00_M99_CWTR. -
Hi ,
I have a resultset which fetches data from different tables. The tables include
columns incolving DATE format. The resultset fetches the date column in the
MM-DD-YYYY HH:MM:SS format. But I need the Date format should be in the
DD-MM-YYYY format.
The problem is the column of Date format is unknown. Is there any way to set this format for the Resultset or at the time of Connection.
Thanks,
ArunI'm not really sure what you mean, but you can change the date format in sql level:
select to_char(sysdate,'DD-MM-YYYY') from dual
or a better approach is to convert the java.sql.Date in Java.
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Date.html -
is it possible to have a central control of data format
for example, all number data are with thousand separator and zero decimal place.
if some columns have data format, user can customize it (like current way - set manually in column property)Hi.
Yes, you can edit this in localedefinitions.xml whic is located in:
...OracleBI\web\config\localedefinitions.xml
<--property name="decimalSeparator">.<--/property>
<--property name="thousandsSeparator">,<--/property>
or in Answers you can save in the column properties:
as the system-wide default for this data type
Regards
Goran
http://108obiee.blogspot.com -
Group by month/year from DATE FORMAT column
Hi Chaps,
I have a recordset that pulls data from a database, then presents the data in a table. The data is grouped by 'projid', repeated for every 'projid', with a show/hide control, to show all the 'jobid's' relating to that particular 'projid'
This is what I have so far:
Code:
SELECT
tbl_projects.projid,
tbl_projects.projtitle,
tbl_projects.projdue, DATE_FORMAT(tbl_projects.projdue, '%%d/%%m/%%Y') as projdue_format,
tbl_projects.projtype,
tbl_projects.projinvtype,
tbl_projects.FK_custid,
tbl_projects.projcompletedate
tbl_languaget.langtname,
tbl_doctype.doctypename,
tbl_jobs.jobid,
tbl_jobs.FK_projid,
tbl_jobs.jobname,
tbl_jobs.FK_langid,
tbl_jobs.jobpages,
tbl_jobs.jobshipped,
tbl_jobs.jobinvsent,
tbl_jobs.jobtranslatorcharge,
'tbl_jobs' as fromtable,
tbl_customers.custid,
FROM tbl_projects
INNER JOIN tbl_jobs
ON tbl_projects.projid=tbl_jobs.FK_projid
INNER JOIN tbl_languaget
ON tbl_languaget.langtid=tbl_jobs.FK_langid
INNER JOIN tbl_customers
ON tbl_customers.custid=tbl_projects.FK_custid
INNER JOIN tbl_costs
ON tbl_costs.FK_custid=tbl_customers.custid
INNER JOIN tbl_doctype
ON tbl_doctype.doctypeid=tbl_jobs.FK_doctypeid
WHERE tbl_projects.projstatus='Complete'
AND tbl_projects.projinvtype='Costing Sheet'
AND langtname!='TH'
AND langtname!='ID'
AND langtname!='KO'
AND langtname!='JP'
AND jobinvsent='y'
AND FK_custid = %s
ORDER BY projid ASC", GetSQLValueString($colname_rsInvPending, "int");
$rsInvPending = mysql_query($query_rsInvPending, $conndb2) or die(mysql_error());
//$row_rsInvPending = mysql_fetch_assoc($rsInvPending);
$totalRows_rsInvPending = mysql_num_rows($rsInvPending);
Code:
// REPEAT - FOR EVERY PROJECT
<?php
$previousProject = '';
if ($totalRows_rsInvPending > 0) {
// Show if recordset not empty
while ($row_rsInvPending = mysql_fetch_assoc($rsInvPending)) {
if ($previousProject != $row_rsInvPending['projid']) {
// for every Project, show the Project ID
?>
Code:
// SHOW/HIDE CONTROL
<tr>
<td colspan="9" class="highlight"><span class="blueBold"><a href="#" onclick="toggle2('proj1<?php echo $row_rsInvPending['projid'] ?>', this)"><img src="../../Images/plus.gif" border="0" /></a> <?php echo $row_rsInvPending['projid'] ?> - </a></span><span class="blueNOTBold"><em><?php echo $row_rsInvPending['projtitle'] ?></em></span></td>
</tr>
Code:
// SHOW/HIDE
<?php $previousProject = $row_rsInvPending['projid']; } ?>
<tr class="proj1<?php echo $row_rsInvPending['projid'] ?>" style="display:none">
<td>column 1</td>
<td>column 2</td>
What I want, is to put in another grouped by stage, where the 'projid's' themselves are in a show/hide region, grouped by 'projcompletedate' (year/month). 'projcompletedate' is in DATE format, but how to I get PHP/SQL to take the month and year and then group them correctly?Hi David, I'm not sure if I've got this right, would you mind looking at my latest code?:
<table border="0" cellpadding="0" cellspacing="0" id="tblinvoice">
<tr>
<th>Job Title</th>
<th>Type</th>
<th>Language</th>
<th>Translator</th>
<th>Total</th>
<th>Full</th>
<th>Fuzzy</th>
<th>Proof</th>
<th>Full Price</th>
<th>Discount Price</th>
<th>Document Format</th>
<th>Pages</th>
<th>Typesetting Cost</th>
<th>EN Proofreading Cost</th>
<th>Total</th>
<th>Translator Charge</th>
<th>Profit</th>
<th>Profit Percentage</th>
</tr>
<?php
$previousMonth = '';
if ($totalRows_rsInvPending > 0) {
// Show if recordset not empty
do ($row_rsInvPending = mysql_fetch_assoc($rsInvPending)) {
if ($previousMonth != $row_rsInvPending['themonth']) {
// for every Month, show the Month Name
?>
<tr>
<td colspan="18" class="highlight"><?php echo $row_rsInvPending['theyear'] ?> - <?php echo $row_rsInvPending['themonth'] ?></td>
</tr>
<?php $previousMonth = $row_rsInvPending['themonth']; } ?>
<?php
$previousProject = '';
if ($totalRows_rsInvPending > 0) {
// Show if recordset not empty
while ($row_rsInvPending = mysql_fetch_assoc($rsInvPending)) {
if ($previousProject != $row_rsInvPending['projid']) {
// for every Project, show the Project ID
?>
<tr>
<td colspan="18" class="highlight"><span class="blueBold"><a href="#" onclick="toggle2('proj1<?php echo $row_rsInvPending['projid'] ?>', this)"><img src="../../Images/plus.gif" border="0" /></a> <?php echo $row_rsInvPending['projid'] ?> - </a></span><span class="blueNOTBold"><em><?php echo $row_rsInvPending['projtitle'] ?></em></span></td>
</tr>
<?php $previousProject = $row_rsInvPending['projid']; } ?>
<tr class="proj1<?php echo $row_rsInvPending['projid'] ?>" style="display:none">
<td><?php echo $row_rsInvPending['jobname']; ?></td>
<td><?php echo $row_rsInvPending['projtype']; ?></td>
<td><?php echo $row_rsInvPending['langtname']; ?></td>
<td><?php echo $row_rsInvPending['translator']; ?></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?php } while ($row_rsInvPending = mysql_fetch_assoc($rsInvPending)); ?>
<?php } // Show if recordset not empty ?> -
Not able to save date column with custom date format. in OBIEE 11g
Hi,
I have migrated one report from OBIEE 10g to 11g. There is a date column with customized date format(i.e. Default format is 'dd-MMM-yyyy' and I have used 'MMM-yyyy').
But when I use this custom format and try to save the report in 11g its giving this below error.
''Catalog object privilege validation failed for user to path /shared/ALM BI/Finacial Results/History Income Statement Detail.
You do not currently have sufficient privileges to save a report or dashboard page that contains HTML markup.
This HTML might be present in column headings, table headings, text views, narrative views, the print header,
or the print footer and must be removed before saving.''
Please let me know what changes I need to do for this.
Regards,
Ambika Nanda.Hi ,
privilage issues...check the security settings once..
Thanks,
Ananth -
I am having trouble getting a numbers spreadsheet to hold different formats in the same column. A column with a date formatted heading will not convert to $ for the cells below. Any suggestions would help.
Hi Wayne,
Thank you for this response. I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.
Kind regards
Paul -
DATE format - while defining the table column
Hi Friends,
I came across a piece of code which was applying a TO_DATE() function on a date type column.
I have two tables t1 and t2 and they have col1 and col2 columns respectively of type DATE
t1
col1 DATE
t2
col2 DATEalso there is a variable var1 and is defined as below:
var1 DATE;now I have conditions as below in the code:
AND to_date(t1.col1,'dd/mm/yyyy') = to_date(t2.col2,'dd/mm/yyyy')
AND to_date(t1.col1,'dd/mm/yyyy') = to_date(var1,'dd/mm/yyyy')This code failed on Production with an error: ORA-01861 literal does not match format string
I changed the code to remove TO_DATE() and it worked fine. Dev clarified that they used this function so that if the two columns or variable are in diff date format.,..they can be put in sync.
e.g. if col1 is dd/mm/yyyy and col2 is mm/dd/yyyy then there will be an issue.
My doubt is.. in a given environment if we are creating a table and defining a column of type DATE , or defining a variable of type DATE, can their format be different at any time? I think No.?
In what scenario can the date format be different?
Thanks,Having said that date format is only for display purposes, if you tend to avoid the error without changing the code then you can modify the NLS_DATE_FORMAT parameter at session level.
SQL> alter session set nls_date_format = 'dd-mm-yyyy'
2 /
Session altered.
SQL> select to_date(sysdate,'dd/mm/yyyy') from dual
2 /
TO_DATE(SY
29-12-2008
SQL> alter session set nls_date_format = 'mm-dd-yyyy'
2 /
Session altered.
SQL> select to_date(sysdate,'dd/mm/yyyy') from dual
2 /
select to_date(sysdate,'dd/mm/yyyy') from dual
ERROR at line 1:
ORA-01843: not a valid month
SQL> select to_date(sysdate,'mm/dd/yyyy') from dual
2 /
TO_DATE(SY
12-29-2008Thanks,
Karthick.
Maybe you are looking for
-
How do i use IPAD wifi when travelling
I have been extensively using IPAD 2 . I recently decided to upgrade mine to IPAD3 . I bought one at the grove apple store and before that asked the salesman the difference in the IPAD 2 AND IPAD 3. He said the resolution of camera and picture was go
-
How can I get my music from another account so I can current account
I have music & money I have a old account I want to put on my new account how do I do that?
-
Hello, my daughter's ipod nano (4th generation) is no longer recognised on itunes and on its settings it says 0KB used 0KB free !! How can I get it working again? I have done the usual restart/restore thing but it just comes back the same once I've
-
HT4759 When is ios8 available in Canada
I Want to know when we will be getting ios8 in Canada.
-
How can I import photos to my ipad from someone else's imac?
I have a mobile me account and can get to it with browser. I am on someone else's computer and have some pictures in their iPhoto that I want to move to my iPad. Is there some way to get them there when I do not have access to my iMac? Can I somehow