'yyyy/MM/dd'
I want to sort my one of the field to this and I am just wondering if this is right 'yyyy/MM/dd'
can I do this ?
to_char(to_date({BOND.EFFECT_DT}),"yyyy/MM/dd")
user452051 wrote:
thank you for the reply but I am working with crystal reprot and I have to change to char. I am just wondering if I can format the date field this way.'yyyy/MM/dd'Regardless of how you want the data displyed on the report your "order by" clause is not something that is displayed.
You can simply do something along the lines of
select to_char({BOND.EFFECT_DT}, 'yyyy/mm/dd') as effect_dt, ...
from ...
where ...
order by {BOND.EFFECT_DT};e.g.
SQL> select * from x;
Y
10-JAN-08
01-JAN-08
21-FEB-08
15-FEB-08
SQL> select to_char(y, 'YYYY/MM/DD') as dt
2 from x
3 order by y;
DT
2008/01/01
2008/01/10
2008/02/15
2008/02/21
SQL>
Similar Messages
-
I have a situation, where i need to write expression Period to date(PTD). i want to know how to get the period date. i want you to help in writing Period date or else is there any function to get period date for a given date(the date is given
from the parameter dynamically) in MDX for SSRS report
ramHi ram,
Per my understanding that you want to get the period date based on the month selected and the given date, right?
Could you please provide details information below to help us better understanding your requirements, thus we will be more effective to provide an solution:
What is the format of the period date you want to get, is this date in the DB and you want to filter it based on the month and the given Date?
Did the month and given date are two parameters in the report? if possible, could you please provide some sample data in the DB and also the snapshot of the report structure
I assume you want to get the period date(mm/dd/yyy) between the select month(e.g:Feb) and the given date (10/1/2014) and you should get the date between(02/01/2014-10/1/2014).
If so,and you also have two parameter "Month","EndDate"(EndDate is the given date), please reference to details information below:
You can create an new parameter "BeginDate" (Date/Time) which is the begin date of the period, you can use the expression to get the value based on the value of the month and the year value from the given date,finally hide this parameter:
Specify the available value:
Label:=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value)
Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
Specify the default Value:
Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
Add filter to the dataset as below:
Preview you will get all the date in the given Period:
If you still have any problem, please feel free to ask.
Regards
Vicky Liu -
How to Convert MM/DD/YYYY to YYYY/MM/DD in SQL Reporting Services
i am having difficulty of converting a parameter field, called @startdate, on sql reporting services report to YYYY/MM/DD format. the parameter @Startdate was set to Data/Time. @Startdate is 6/1/2014 12:00:00 and I want to convert it
to 2014/06/01. I want to compare @Startdate with a column in database called Begindate which is in format of YYYY/MM/DD hh:mm:ss. I tried the followings
select * from Atable where cast(Atable.Begindate as date) >= cast(@Startdate as date)
select * from Atable where cast(Atable.Begindate as date >= cast(convert(datetime, @Startdate) as date)
SQL Reporting Services only gives me Text, Boolean, Date/Time, Integer and Float.
Regards,Hi Elmucho,
Sorry for the delay. I tested with the sample data you provided, however everything works well in-house. Could you please creste a new report and check the result. Here are the steps I performed:
1. Create a table and insert the following data:
Name (varchar(50)) Begindate (datetime, not null)
Lastdate (datetime, not null)
bob
2008-01-01 08:08:08.000 2010-10-10
10:10:10.000
alice
2010-10-10 10:10:10.00 2011-11-11
11:11:11.000
smith
2011-11-11 11:11:11.00 2012-12-12
12:12:12.000
2. Open SQL Server Data Tools, create the data source and add the dataset with the below query:
SELECT Name, Begindate, Lastdate
FROM [tablename ]
WHERE (CAST(Begindate AS date) >= CAST(@Startdate AS date)) AND (CAST(Lastdate AS date) <= CAST(@Enddate AS date))
3. Then, click execute button, it prompts for inputting the parameter value.
@Startdate
6/1/2008
@Enddate
5/1/2014
Enter the date and press OK.
4. Here is the result in the query designer:
Insert a table and fields. Save the report and preview:
Thanks.
Tracy Cai
TechNet Community Support -
Need to convert Date from calendar to String in the format dd-mom-yyyy
Need to convert Date from calendar to String in the format dd-mom-yyyy+..
This is absolutely necessary... any help plz..
Rgds
ArwinderLook up the SimpleDateFormat class: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
Arwinder wrote:
This is absolutely necessary... any help plz..For you maybe, not others. Please refrain from trying to urge others to answer your queries. They'll do it at their own pace ( if at all ).
People on the forum help others voluntarily, it's not their job.
Help them help you.
Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
(Yes I know it's on JavaRanch but I think it applies everywhere)
---------------------------------------------------------------- -
Problem with date format dd/mm/yyyy. But I need to convert yyyy-mm-dd.
Dear friends,
I have the problem with date format. I receiving the date with the format dd/mm/yyyy. But I can upload to MySQL only in the format of yyyy-mm-dd.
how should I handle this situation, for this I've created these code lines.But I have some problem with these line. please help me to solve this problem.
String pattern = "yyyy-mm-dd";
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
Date date = format.parse("2006-02-12");
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
System.out.println(format.format(new Date()));
this out put gives me Tue Apr 03 00:00:00 IST 2007
But I need the date format in yyyy-mm-dd.
regards,
maza
thanks in advance.Thanks Dear BalusC,
I tried with this,
rs.getString("DATA_SCAD1")// where the source from .xls files
String pattern = "yyyy-MM-dd";
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
Date date = format.parse("DATA_SCAD1");
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
System.out.println(format.format(new Date()));
this out put gives me Tue Apr 03 00:00:00 IST 2007
But I want to display the date format in yyyy-mm-dd.
regards,
maza -
Search and replace YYYYMMDD to DD-MM-YYYY (in file)
I have a problem with date formatting. There is a mismatch between my banks .csv file and the standard of iBank...
I would like to make an AppleScript (or Automator/AppleScript) app which search .csv file for strings "YYYYMMDD" and replaced it with "DD-MM-YYYY", but frankly I am not an AppleScript star There is a line of the .csv file below.
"NL000BANK0000000000";"EUR";"20130101";"C";"100.00";"NL000BANK0000000000";"";"20 130102";"";"";"Accountholder";"Transactionnote";"";"";"";"";"";"";""
Does anybody can help me with it?You could run the following in an Automator "Run Shell Scrpt" (or Applescript)
awk '
while( match($0,/\"[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\"/) ) {
date = substr($0,RSTART+1,8)
year = substr(date,1,4)
month = substr(date,5,2)
day = substr(date,7,2)
new = day "-" month "-" year
if ( month+0 >= 1 && month+0 <= 12 &&
day+0 >= 1 && day+0 <= 31 &&
year+0 != 0 ) {
sub(date,new,$0)
print
' $1 >$HOME/new_$1
You would change the "Pass input:" to "as arguments" which will populate $1 with the file you drag and drop onto the Automator app you create.
The script will create a new file in your home folder with "new_" in front of the name from the file you dragged and dropped onto the automator app you create. -
How to display date field in ALV in format 'YYYY-MM-DD'?
Hi experts,
I am not getting displayed the date field in ALV in the format 'YYYY-MM-DD' if it is different than my user setting's format (DD.MM.YYYY).
Tried with the edit mask
LVC_S_FCAT-EDIT_MASK = '____-__-__' but it does not work.
I could not find the conversion routine for this. Is it possible to write customer conversion routine?
I have to use DATE field, otherwise if I display this format in CHAR10 field , sorting in ALV does not work for this field.
PLEASE ANY HELP!
Kind regards,
DanijelaHi,
Use FM FORMAT_DATE_4_OUTPUT.
TYPE-POOLS : slis, KKBLO.
TYPES: BEGIN OF t_data,
sel TYPE char1,
matnr TYPE matnr,
bldat type char10,
END OF t_data.
DATA: it_tab TYPE STANDARD TABLE OF t_data,
it_fcat TYPE slis_t_fieldcat_alv.
DATA: wa_tab TYPE t_data,
wa_fcat TYPE slis_fieldcat_alv,
wa_layout type SLIS_LAYOUT_ALV.
data: lv_repid TYPE syrepid.
data : lv_date type NLEI-IBGDT,
lv_outdate type RN1DATUM-DATEX,
lv_format type RN1DATUM-FORMAT value 'YYYY-MM-DD'.
lv_repid = sy-repid.
lv_date = sy-datum.
CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
EXPORTING
datin = lv_date
format = lv_format
IMPORTING
DATEX = lv_outdate.
move lv_outdate to wa_tab-bldat.
wa_tab-matnr = '0000001'.
APPEND wa_tab TO it_tab.
lv_date = sy-datum + 1.
CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
EXPORTING
datin = lv_date
format = lv_format
IMPORTING
DATEX = lv_outdate.
move lv_outdate to wa_tab-bldat.
wa_tab-matnr = '0000002'.
APPEND wa_tab TO it_tab.
lv_date = sy-datum + 2.
CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
EXPORTING
datin = lv_date
format = lv_format
IMPORTING
DATEX = lv_outdate.
move lv_outdate to wa_tab-bldat.
wa_tab-matnr = '0000003'.
APPEND wa_tab TO it_tab.
wa_fcat-fieldname = 'SEL'.
wa_fcat-ref_fieldname = 'XCHPF'.
wa_fcat-ref_tabname = 'MARA'.
wa_fcat-edit = 'X'.
wa_fcat-checkbox = 'X'.
APPEND wa_fcat TO it_fcat.
CLEAR : wa_fcat.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-ref_fieldname = 'MATNR'.
wa_fcat-ref_tabname = 'MARA'.
APPEND wa_fcat TO it_fcat.
CLEAR : wa_fcat.
wa_fcat-fieldname = 'BLDAT'.
wa_fcat-ref_fieldname = 'BLDAT'.
wa_fcat-ref_tabname = 'BKPF'.
APPEND wa_fcat TO it_fcat.
call 'REUSE_ALV_GRID_DISPLAY'' after this
Edited by: Ankur Parab on Oct 1, 2009 2:50 PM
Edited by: Ankur Parab on Oct 1, 2009 2:51 PM -
RFC Function Error: Cannot convert a value of 'MM/DD/YYYY' from type java.l
hi experts,
iam calling an RFC using SAP_JCO_Function. one of the input parameters is date which shud be in the format 'MM/DD/YYYY' but when i create a transaction property of data type DATETIME the format changes to " 2007-06-21 14:31:50 ". to refrain form passing this value at run time i have defined the transaction property as string and defaulted the value to MM/DD/YYYY.
When i execute the RFC i get the error "Cannot convert a value of 'MM/DD/YYYY' from type java.l".
Issue is with time field as well. Any suggestions would be appreciated.
Thanks,
AvinashHi
You can use datefromxmlformat( datetime, toformat ) .
in toformat you give: "MM/dd/yyyy" and in datetime you pass your xml format date like: 2007-06-21 T14:31:50.
Try like this. Hope this may help you.
Thanks -
Query records using a date DD-MON-YYYY in Forms 6i and 10g
In Forms 6i, I can query records by entering >20-dec-2006 in a date field which has length of 12 with a date format mask DD-MON-YYYY in date item property. Once this form is converted to 10g, I can only enter >2-dec-2006 for querying. If trying to enter the >20-dec-2006, then, it becomes >20-dec-200 and have no record found. Although I have the date length increased to 20, the result stays the same: can't enter 2 digits for day.
Thanks for your help in advance.Appreciate your help. The date field has a format mask of DD-MON-YYYY. By entering >2-dec-2005 it will automatically be displayed as >2-DEC-2005 in Forms 6i or 10g. Also, the query property has case insensitive checked as Yes. The problem is with 10g, I can not enter anything at the 12th position. I can enter the date up to the 11th position >20-dec-200. In Forms 6i, this is not a problem. Thanks.
-
Reports 6i to 10g Migration (Value Does Not Match mask 'MM/DD/YYYY'
Dear all,
I am Migrating Oracle 6i Reports to 10g. I am just compiling the 6i Reports in 10g Reports Builder and giving the
Report for Deployment after it got successfully ran in the report builder.
In one of the Report Report Query i am checking date range like below
WHERE lov_dte BETWEEN :L_FRM_DTE AND :L_TO_DTE
L_FRM_DTE and L_TO_DTE input mask is MM/DD/YYYY
i got the output in report builder and as well as from the application also but after the compiled the same report
in 10g and tested in server ..
i am getting the following error in server ..
REP-546:Value does not match mask 'MM/DD/YYYY'
ORA-01030:Date format picture ends before converting entire input string
REP-0091:Invalid value for parameter L_FRM_DTE
any body faced the same problem ...please help me to resolve this issue ..
I Tried Changing the Query to
WHERE lov_dte BETWEEN to_date(:L_FRM_DTE,'mm/dd/yyyy') AND to_date(:L_TO_DTE,'mm/dd/yyyy')
but still no use because iam getting runtime error ORA-01858 NON NUMERIC CHARACTER WAS FOUND WHERE A NUMERICA CHAR WAS EXPECTED.
Thank you all for Looking into my problem..
Data BoyDear all i found the document related to this problem in META LINK ..The Bug no is 5597464
The base of this Bug is 4589885
It is given that
Fixed in Product Version 11.0
but when i go to oracle site ..i cant find this version for Developer suite. can anyone please help in this
there is only Oracle Developer Suite 10g (10.1.2.0.2).
Thank you all for looking into my problem. -
How to generate current time in the format yyyy-mm-ddThh:mm:ssZ in the xslt
Hello,
i am tring to generate current time in the format yyyy-mm-ddThh:mm:ssZ in my xlst file.
the following info are necessary,
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"
version="1.0">
<xsl:attribute name="generationDate"><xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new('yyyy-mm-dd hh:mm:ss'), java:java.util.Date.new())"/></xsl:attribute>
but java SimpleDateFormat doesnt support yyyy-mm-ddThh:mm:ssZ.
thanks in advance.Hi wwuest,
I use the following code to generate such a date format :
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse(strDate);
sdf.applyPattern("yyyy-MM-dd'T'hh:mm:ss");
strDate = sdf.format(date);
} // catching the parse exceptionMaybe you could try this method and see if it pass through xsl with :
new SimpleDateFormat("yyyy-MM-dd").applyPattern("yyyy-MM-dd'T'hh:mm:ss'Z'")Bye -
How do i change the $Date variable format on an Ironport ESA to be DD/MM/YYYY
I have an Ironport ESA running ASyncOS 7.6 and i use the $Date variable in notification emails. It is currently formatted in the US way of MM/DD/YYYY but we need it to be formatted as DD/MM/YYYY. Is there any way to do this? The time zone is correct but i can't find anywhere to modify system variables.
There doesn't appear to be any way to change the formatting of that variable. Perhaps you can make use of $Timestamp or $GMTimeStamp instead?
-
Is it possible to display a date as (DD-MON-YYYY) in excel output using excel template in xml publisher where date should be displayed as date only not string.
I've tried to use hierarchy node variables, but it seems like you can't specify a attribute of the hierarchy such as level. So with the WBS hierarchy, if you create a hierarchy node variable, you specify the WBS value to select (If I understand this correctly). I wish I could instead specify "give me all the WBS nodes that happen to have the value of the level attribute greater or equal to 3. If I understand Juergens post, he is saying make security access so that only certain WBS levels can be returned in the query. I suppose we can try that, but that would then preclude getting the level 1 and 2 in the future if the authorization is global.
-
I am a long-time Elements user (most versions since it first came out) and I have 10s of thousands of photos, mostly stored by downloading from my various cameras through Elements.
Now I have "upgraded" to Elements 10, and discover that it won't allow me to continue with the sequence of folder names that were generated by previous versions.
I have always uploaded my photos into subfolders generated by Elements with names of the format yyyy mm dd. This has the great convenience that these folders sort in date order. I have them going back to 2002 01 24.
Now I have Elements 10, and when I downloaded some new photos it defaulted to subfolder names which don't store in sequence- (yyyy dd mm). So I went to options / camera or card reader to correct this silly default. I looked in the drop-down list and there are a whole lot of what seem to me silly choices, (why would anyone want a folder name that doesn't store in date order?) but not the one I want.
This is quite a serious problem. Suppose I go away for two days, and shoot pictures on .30 Nov 2011 and on 1 Dec 2011 (OK US friends, Nov 30 2011 and Dec 1 2011). Elements 10 will store the first lot as one of the last folders in 2022 (along with shots made on 31 Jan 2011, 31 Mar 2011, etc). My second day's shooting will be stored near the start of the year, along with shots made on the first day of other months.
This is mad!!!!- an absurd bug. But so far it doesn't seem to have been fixed.
Can anyone tell me a way round? Or that there is a fix for this bug that I haven't found? Or that it doesn't happen on anyone else's machine (in which case, why didn't it happen on my machine with Elements 9?)
It's going to be extremely tedious to have to hand-amend all future folder names so that they sort in sequence (and are consistent with my hundreds of existing folders). I can't believe that Adobe would have done this deliberately, so I'm mystified. Help!
My copy of Elements 10 was bought from Amazon UK- must be a standard UK issue. My PC runs under Windows 7.Hello,
I tried the workaround. Changed the setting in Organizer - Bearbeiten - Voreinstellungen - Kamera oder Kartenleser (this is on my German menu. It translates to somewhat like Organizer - Edit - Options - Camera). I got, no matter how I changed these settings to, always the same wrong result yyyy dd mm.
Now I changed in the Control panel, Region and language, Format, Date (short) from my German standard tt.mm.yy to yyyy-mm-dd).
Now the Organizer really creates the correct folder yyyy mm dd !
I do not know yet what disadvantage I have by this change in other applications, there probably will be some (or, more likely, many). If I get serious errors elsewhere, it is not worth to change the control panel setting in a stop-go motion just for PSE to behave correctly. Then it could be better to change the folder names by hand.
But anyway thanks for this hint. I just was not clear where to change the date format.
If anyone finds a better workaround, we all would be eager to hear about it.
PS: With the great tool AutoHotkey, it might be easy to create a script which switches the control panel format stop-go between the 2 formats. In practical use, that would be just a quick shortcut to be keyed in. I'll have to think about that, since I do not expect a fast solution from Adobe.
Greetings,
mcmusic77 -
Get current date in mm/dd/yyyy format
Need to get todays date in the format mm/dd/yyyy and store it in a database by using JDBC API ..how to convert Date given by Date() to the format mmdd/yyyy .The column type of the table whr date has to be inserted is of Type Date/Time (Microsoft Access)..
Plz help me out ..plzzz..public static byte TIME_ONLY = 1;
public static byte DATE_ONLY = 2;
public static byte DATE_ALL = 3;
public static String getCurrentDateTime(byte format, String dateFormatPattern) {
String[] stringArray;
String sDate;
Date today;
SimpleDateFormat formatter;
formatter = new SimpleDateFormat(dateFormatPattern);
today = new Date();
sDate = formatter.format(today);
if (format != DATE_ALL) {
stringArray = sDate.split(" ");
if (format == DATE_ONLY) {
sDate = stringArray[0].trim();
} else {
sDate = stringArray[1].trim();
return sDate;
} -
How To Get Only Month or Only Year from datetime format of yyyy-mm-dd
Hi SQL gurus,
I have field has datetime format of yyyy-mm-dd (ie. 2014-11-28). Could anyone please educate me on how to extract only month (ie. November but not 11) and only year (ie, 2014) from 2014-11-28. I writing two report have title of Number of
sick leaves on November and Number of sick leaves in 2014. I am planning to extact 11 from 2014-11-28 and display as November on report title and the same goes for 2014. Unless you have better non complicated way. Thank you
very much in advance. DingDong!!There are multiple ways
Month name
SELECT DATENAME(mm,@DateParam)
SELECT FORMAT(@DateParam,'MMMM')
Year
SELECT FORMAT(@DateParam,'yyyy')
SELECT DATEPART(yy,@DateParam)
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
Maybe you are looking for
-
Time to Change the Sticky at the top of this forum?
I think that we are past the delivery issues with the Droid X. As far as I know, anyway. I respectfully submit to the Mods that the following information (copied and pasted from a response to a past by Wildman) be posted at the top as a sticky, name
-
TS1368 what is an error 502 and why am i getting it
what is an error 502
-
10.10.10.4 (255.255.55.248) is my workstation on Vlan1 (10.10.10.1) see attached. My fw log indicates drop packet to 10.10.10.4. Does this show my 10 addr is visible externally? Is my internal addr. being NATed correctly? If NAT config is wrong, how
-
Log and Transfer - panasonic HDC-SD5 - quits on startup - AVCHD
Hi Guys, When an SDHC (4Gb) card or HDC-SD5 (via USB) is connected, and I bring up the Log and Transfer window, Final Cut Pro quits without a message. I have been struggling with the same issue with iMovie '08. Please see this thread for details: htt
-
How do I delete a program on my mac
Hi...simple question...I have a program on my Mac I would like to delete. How do I delete an entire program? Thanks!