How to display datetime like below
How to display datetime like below
13-oct-2014 10:11:00
2014-10-13 10:11:00
(I always must display seconds as 00)
format is
dd-mmm-yyyy hh:mm:00
yyyy-mm-dd hh:mm:00
if I use
SELECT FORMAT(getdate(),'dd-MMM-yyyy hh:mm:00')
I'm getting the following error
'FORMAT' is not a recognized built-in function name.
Thats because your version is below 2012
then use the other suggestion which is
SELECT REPLACE(CONVERT(varchar(12),datefield,106),' ','-') + ' ' + CONVERT(varchar(5),datefield,108) + ':00'
FROM Table
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Similar Messages
-
How to design report like below
I Want to make report like this
* I have Query Q1 (vendor_id, vendor_site_id, invoice_id, ....)
* base on criteria on Q1 for example : vendor_site_code = vendor merchandise
I want the output on Q2 (select field A, B,C) ==> I already design on Q_M
base on invoice_Id (Q1)
* base on criteria on Q1 for example : vendor_site_code = vendor non merchandise
I want the output on Q3 (select field D,E,F) different from Q2 => Q_NONM
base on invoice_id (Q1)
The problem is while showing the lines I cannot filtering, always show the first on repeating frame
I design on Report Editor Layout like this for detail / lines
Fix Frame M1
Repeating R1 source(Q2) => using format trigger
Repeating R2 source(Q3) => using format trigger
but it didn't work, always show R1, R2 cannot show
How do I make report like that??if I use
SELECT FORMAT(getdate(),'dd-MMM-yyyy hh:mm:00')
I'm getting the following error
'FORMAT' is not a recognized built-in function name.
Thats because your version is below 2012
then use the other suggestion which is
SELECT REPLACE(CONVERT(varchar(12),datefield,106),' ','-') + ' ' + CONVERT(varchar(5),datefield,108) + ':00'
FROM Table
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to display Long text in a JLabel with multiline??
Hi,
Suppose I have a label that displays a long text....
""This is an example label that displays long text, how to break the line????.........""
how to display it like below with one label?
""This is an example label
that displays long text, how
to break the line????.........""
Thanksso basically do this
JLabel myLabel = new JLabel();
String theText = "<html>This is an example label<br>
that displays long text, how<br>
to break the line????.........</html>";
myLabel.setText(theText);Obivously, u dont have to use a separate string, u could just call setText or pass it into the JLabel constructor, i just separated it to make it easier to see what your supposed to do.
GOod Luck -
Hi everyone,
How to display & sign in below statements such as "A
& B" and "X & Y". Thanks.
<mx:dataProvider>
<mx:Array>
<mx:Object label="A & B" data="1" id="MensClothing"
subcategoryImage="assets/images/MensClothing.gif" />
</mx:Array>
</mx:dataProvider>
<mx:Button
id="button_Home"
x="20" y="2"
fillAlphas="[0,0]"
fillColors="[#4d4d4f, #4d4d4f]"
label="X & Y" color="white" cornerRadius="0"
click="Home()" />
Thanks,
Mayentity equivelant for & in XML is &
<mx:ButtonBar>
<mx:dataProvider>
<mx:Array>
<mx:Object label="A & B" data="1"
id="MensClothing" subcategoryImage="assets/images/MensClothing.gif"
/>
</mx:Array>
</mx:dataProvider>
</mx:ButtonBar>
<mx:Button
id="button_Home"
x="20" y="2"
fillAlphas="[0,0]"
fillColors="[#4d4d4f, #4d4d4f]"
label="X & Y" color="white" cornerRadius="0"
click="false" /> -
How to display output with 5min & 10min averages?
Hi I’ve Data Like below in SqlServer Table
DateTimeMin
Field
Value
2014-10-09 11:01:00
some
1
2014-10-09 11:02:00
some
2
2014-10-09 11:03:00
some
3
2014-10-09 11:04:00
some
4
2014-10-09 11:05:00
some
5
2014-10-09 11:06:00
some
6
2014-10-09 11:07:00
some
7
2014-10-09 11:08:00
some
8
2014-10-09 11:09:00
some
9
2014-10-09 11:10:00
some
10
If I Run a query, I need Output like below (5 minute average)
DateTimeMin
Field
Value
2014-10-09 11:05:00
some
3
2014-10-09 11:10:00
some
8
If it’s 10 minute average, I need output like below
DateTimeMin
Field
Value
2014-10-09 11:10:00
some
5.5
at where clause, I've to use DateTimeMin between
2014-10-09 11:01:00 and 2014-10-09 11:10:00
Please advise, how?Hi Visakh
at present I'm getting output like below
ID
DateTimeMin
Value
1
2014-10-09 11:05:00
3
2
2014-10-09 11:10:00
8
How to get output like below(I need to add the Field Column)
ID
DateTimeMin
Field
Value
1
2014-10-09 11:05:00
some
3
2
2014-10-09 11:10:00
some
8
I tried several ways, but unable to get it(The Field Data is same from min 1 to 10) -
How do i display text information below an ALV grid.??
Hi.
I need to display my output in an ALV GRID.
also i need to display summary details below the ALV grid. the smmary values keep changing dynamically depending upon selection screen inputs!!chk this report..write your code in the footer
*& Report ZRJR02 *
REPORT ZRJR02 .
*Table declaration.
TABLES:ZEMP_MST,ZDEPT_MST,ZDESG_MST,ZSL_TXN.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
*DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
data: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
*Internal table declaration.
*DATA BEGIN OF IT_SORT OCCURS 5.
* INCLUDE TYPE SLIS_SORTINFO_ALV.
*DATA END OF IT_SORT.
DATA:BEGIN OF ITAB OCCURS 0,
ZEMPNO LIKE ZEMP_MST-ZEMPNO,
ZEMPNAME LIKE ZEMP_MST-ZEMPNAME,
ZDEPTCD LIKE ZEMP_MST-ZDEPTCD,
ZDEPTNAME LIKE ZDEPT_MST-ZDEPTNAME,
ZDESGCD LIKE ZEMP_MST-ZDESGCD,
ZDESGNAME LIKE ZDESG_MST-ZDESGNAME,
END OF ITAB.
REFRESH ITAB.CLEAR ITAB.
START-OF-SELECTION.
SELECT A~ZEMPNO A~ZEMPNAME A~ZDEPTCD B~ZDEPTNAME A~ZDESGCD C~ZDESGNAME
FROM ZEMP_MST AS A
INNER JOIN ZDEPT_MST AS B
ON A~ZDEPTCD EQ B~ZDEPTCD
INNER JOIN ZDESG_MST AS C
ON A~ZDESGCD EQ C~ZDESGCD
INTO CORRESPONDING FIELDS OF TABLE ITAB.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
perform f_build_eventcat.
PERFORM LAYOUT.
END-OF-SELECTION.
*& Form LAYOUT
FORM LAYOUT .
PERFORM FCAT USING 'ZEMPNO' 'ITAB' '' 'Emp.No.' 'ZEMPNO' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZEMPNAME' 'ITAB' '' 'Emp. Name' 'ZEMPNAME' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTCD' 'ITAB' '' 'Dept.Code' 'ZDEPTCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDEPTNAME' 'ITAB' '' 'Dept.Name' 'ZDEPTNAME' 'ZDEPT_MST' ''.
PERFORM FCAT USING 'ZDESGCD' 'ITAB' '' 'Desg.Code' 'ZDESGCD' 'ZEMP_MST' ''.
PERFORM FCAT USING 'ZDESGNAME' 'ITAB' '' 'Desg.Name' 'ZDESGNAME' 'ZDESG_MST' ''.
* PERFORM LSORT USING 'ZEMPNO' 'IDATA' ''.
* PERFORM LSORT USING 'ZEMPNAME' 'IDATA' ''.
* MOVE IT_SORT[] TO GT_SORT[].
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = F1
* IT_SORT = GT_SORT
I_SAVE = 'X'
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = ITAB.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
*& Form LSORT
*FORM LSORT USING P_FIELD P_TABLE P_UP.
* ADD 1 TO L_POS.
* IT_SORT-SPOS = L_POS.
* IT_SORT-FIELDNAME = P_FIELD.
* IT_SORT-TABNAME = P_TABLE.
* IT_SORT-UP = P_UP.
* APPEND IT_SORT.
*ENDFORM. " LSORT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " F_BUILD_EVENTCAT
FORM F_REPORT_HEADER_ALV.
CALL FUNCTION 'Z_YHEAD_PRINT'
EXPORTING
TITLE1 = 'XYZ Limited'
TITLE2 = 'Employee Master'
TITLE3 = 'Created on '
COLOR = 'X'
ENDFORM.
*& Form F_WRITE_SUMMARY
* Write summary before exit
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'.
ENDFORM. -
Please help : How to make the anomalistic table just like below?
Hi all,
How to make the anomalistic table just like below? Anyone can give the way detail or thoughtway ?
http://61.132.17.188/webber/table.gifThis is just a suggestion.
If you put your "JTable" in a "JScrollPane", then you can add any "java.awt.Component" to the corner of the "JScrollPane" -- using the "setCorner()" method (of "JScrollPane").
I would suggest making a custon "JPanel" and overriding its "paintComponent()" method to draw a diagonal line (and the required text) on it.
You can find out more about how to do this from the links I provided in my first reply.
Hope this helps.
Good Luck,
Avi. -
How to display a Math symbol with Subscript(like "Xad", make the "ad" be Subscript )
How to display a Math symbol with Subscript(like "Xad", make the "ad" be Subscript )
I need to show "Xad"(ad is Subscript )
I try to find the letter subscript......but ,Unicode set is not have.....
I try to use X<sub>ad</sub> show it whit Text.htmlText, but is not used, I think Flex's HTML is not support the <sub> mark.
can you tell me , how to display a Math symbol with Subscript(like "Xad", make the "ad" be Subscript )
thank you very much.....http://blog.ggshow.com/index.php/how_to_use_subscript_aamp_superscript_in?blog=11
http://jasonbejot.com/superscript-and-subscript-in-actionscript
and thank you very very muck -
HOW TO GENARATE DATE LIKE 12 DEC 2007 USING xp20:format-dateTime(dateTime a
HOW TO GENARATE DATE LIKE 12 DEC 2007 USING xp20:format-dateTime(dateTime as string, format as string). PLEASE HELP.
If i look at the w3 org i would say :
xp20:format-dateTime('yourfield','[D]-[[MN,*-3]-[Y]')
or just MN will do too. -
How to display Barcode in RTF ?
How to insert Barcode for the item in RTF using BI Publisher in Ms word. I did like below
<?format-barcode:*Item*;Code128a;XMLPBarVendor?>
But in the output Barcode is not displaying for that item.Hi,
Try the below link
[http://help.sap.com/saphelp_nw04/helpdata/en/d9/4a95e351ea11d189570000e829fbbd/content.htm]
Regards,
Surinder -
can anyone tell me how to display the selected contents of
the database by using a variable from my form field(like text box
)Hello Guys!
Sorry forever to get back. Going to throw this up here quick
so I dont time out, but if you need further help post back and I
will help with specific questions.
Using the City, State example. This operation is two fold.
(a) the search page, and (b) the results page.
(a) On your search page you would have two fields. City and
State. Make sure your table that holds these fields are containted
within a form tag. (Insert > Form > Form). Also make sure
your textfields have names. You can click on the textfield to
highlight in design view and change the name from 'textfield' and
'textfield1' to 'city' and 'state'..
Highlight the form tag and in the properties panel where it
says "action" insert the URL/file of your results page. This is the
page that is actually going to display the information, then save
your work.
(b) Open up your results page, and in the bindings panel
click the "+" then select query. In the 'simple' window name your
recordset (example: rsStores) select your connection, then select
the table you desire to display results from. From this window you
can also choose a field to use as an order by. Do not use the
filter!
With this done and 'without' saving yet, click on the
"advanced" tab. You should now see and a simple statement in the
window that looks something like:
SELECT *
FROM Stores (The name 'Stores' will actually be replaced with
your table name)
Below the statement you will see 'parameters' with a + and -.
Hit the plus to add a parameter. For name use varState, for Type
use text, for Value use Request("State") and for default value use
zero. Replicate the process for varCity using Request("City") for
the value. (The requests are the same names as the names you used
to name your fields in the search form). Now go up to the original
statement and edit it to look like this:
SELECT *
FROM Stores WHERE yourfieldname = varState AND WHERE
yourfieldname = varCity
Replace 'yourfieldname' with the actual field name holding
the values. Keep EVERYTHING case sensitive. Testing in design view
will not work because there are no values yet passed. So click ok,
save the page and upload them to server. Test by going to the
search page and submitting the search form.
Hope that helps..!! -
How to display the subtotals (BPC NW 7.5)
We are on BPC-NW 7.5
I have to develop a schedule where I have to show totals at each parent node based on what they enter for the base members. (Is it possible to show totals before they save, as they enter data?)
If my dimension is as below
Parent1
Parent11
Base111
Base112
Parent12
Base121
Base122
Parent13
Base131
Base132
My report should look like below when i do a row expansion on Parent1
Base111 --- --- ---
Base112 --- --- ---
Parent11 <sub> <sub> <sub total>
Base121 --- --- ---
Base122 --- --- ---
Parent12 <sub> <sub> <sub>
I know when we use AfterRange we can use the EVSUM to get the total when you have a nested expansion on the row.
I am not sure how you do this when you are not doing nested expansion.
One more thing is I need to insert a blank line after each subtotal.
Can someone share their thoughts on how to achieve this?
Thanks
-SHi Shilpa,
You can do one thing for getting a blank space before your parent(Sub-Total), I think you are taking Accounts in Rows
and Time in Col., assuming that go to your account dimension and add a member before your parent member. Example you may
be having members 001,002,003,004 (in your account dimension )etc., if you check your report before Parent/subtotal the member 004 will be displayed, so you add one member 005 description some dot(.) and process the account dimensiont. when you go for reports in BPC Excel, please remove Y from "Surpress" in control panel. So that you will get a blank line before sub-total.
I hope you understand what i mean.
Raghu B.S.
Edited by: Raghu B.S. on Jul 25, 2011 12:57 PM -
How to display multiple column in report
Hi Abaper,
I have client requirment to develop new report for sim hotel.
The requirment is we have select multiple hotel , based on hotel selection the report will display, the report layout like:
Hotel1 |Hotel2 |Hotel 3
Day |Month |Year |Day |Month |Year |Day |Month |Year
Please any one can give me idea how to develop same layout for this requirment.
Thanks in Advance.
Regards,
SouravHi,
U can use write statement like below
write:/ 'Day 1'.
write:20 'Year 1'.
This will leave 20 spaces between Day 1 and Year 1.
For more information u can go to transaction 'ABAPDOCU' and in Keyword help type 'Write' u will get all options u can use with write statement.
Let me know further.
Cheers,
Parth Parikh -
How to display the results in order by based on search value
Hi All,
how to display the results in the below order.
CREATE TABLE TEST( SONGID NUMBER, TITLE VARCHAR2(200))
INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');
INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
SELECT *FROM TEST WHERE INSTR (TITLE, 'MADONNA') > 0
output:
SONGID TITLE
10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
11 CICCONE, MADONNA (CA)
12 DALLIN, MADONNA LOUISE/STOCK
13 MADONNA
14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
15 MADONNA (CA)
16 MIRWAIS AHMADZAI, MADONNA
17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
18 MADONNA (CA),CICCONE
Expected output :
13 MADONNA
14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
15 MADONNA (CA)
18 MADONNA (CA),CICCONE
...if user searches with 'MADONNA' , I have to display the results like title starts with 'MADONNA' first then rest of the records.
Please let me know is it possible to display the results in that order.
Regards,
RajasekharThis may be a bit more accurate:
SQL> SELECT *
2 FROM TEST
3 WHERE INSTR (TITLE, 'MADONNA') > 0
4 ORDER BY INSTR (TITLE, 'MADONNA')
5 ,TITLE
6 ;
SONGID TITLE
13 MADONNA
14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
15 MADONNA (CA)
18 MADONNA (CA),CICCONE
12 DALLIN, MADONNA LOUISE/STOCK
11 CICCONE, MADONNA (CA)
17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
16 MIRWAIS AHMADZAI, MADONNA
10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA) -
How to display the time length of video (current time/ total time) ?
Hi,everyone. I would like to ask how to display the time length of the video which show only in system example: it show the current time and total time? using AS 3.0.
It there any information or solution to solve it? .
I appreciate it any of you able to answer it. ^^
Thank you.Hi,
Actually I have this requirement for MAC OS 10.5. With the code you provided, I got the output as "6289375". When I changed the URL to point to my file (file:///Users/VPKVL/Desktop/MyRecord/tempAudio.wav), I am getting the below mentioned Exception:
Exception in thread "main" javax.sound.sampled.LineUnavailableException: Failed to allocate clip data: Requested buffer too large.
at com.sun.media.sound.MixerClip.implOpen(MixerClip.java:561)
at com.sun.media.sound.MixerClip.open(MixerClip.java:165)
at com.sun.media.sound.MixerClip.open(MixerClip.java:256)
at TestWavLength.main(TestWavLength.java:13)The "tempAudio.wav" file is created by using java sound API. I am using the SSB USB Headphone Set to record the audio with the following settings for AudioFormat object:
AudioFormat audioFormat = new AudioFormat(
AudioFormat.Encoding.PCM_SIGNED, // the audio encoding
// technique
48000.0F,// sampleRate the number of samples per second
16, // sampleSizeInBits the number of bits in each sample
2, // channels the number of channels (1 for mono, 2 for
// stereo, and so on)
4, // frameSize the number of bytes in each frame
48000.0F,// frameRate the number of frames per second
false); // bigEndian indicates whether the data for a single
// sample is stored in big-endian byte order
// (false means little-endian)Can you please suggest where I am going wrong ?
Maybe you are looking for
-
Carrying scheduling cosidering all 365 days are working days
when I am carryying out scheduling for a process order in which resource is assigned with 365 days as working days calender, it is displaying saturday and sunday as non working days and no operations being planned on those days. Even plant is assign
-
Location bar does not display in CSH window
Good morning all, I've got a RH8 project calling a custom CSH window. We want the location bar to appear in the help window so users can navigate forward and backwards among the topics. I've created a new window in RH8 and selceted the Location Bar a
-
Computer not Turing on!!!!!!!!!
Why isn't my computer turning on? I did the diagnostic test,and sometimes it show that I need to replace both the power supply and the logic board. Sometimes it show LED 1 and sometimes it shows LED 1&2. 2 time though, it has turned on. What the heck
-
hi sap gurus, good afternooon toall, is there any possibility for extraction of statutory reports in std sap r/3 with out any customization is there any possibility ? for eg: the reports which will be given for internal audit purpose. like tax, lst,v
-
Where is the FC Studio plug ins folder?
Hi, Basic question here. I am trying to install a few new noise reduction filters in Final Cut since Compressor is quickly dying before my eyes! Where in the world is the Final Cut Studio plug ins folder? It used to be Library - App Support - Final C